function pick(actual, fields) {
  const newObject = {};
  fields.forEach((field) => {
    newObject[field] = actual[field];
  });
  return newObject;
}
@description Pick only properties in fields array.
@param {object} actual - Current object.
@param {Array} fields - Array of fields to pick.
@returns {object} Return object with selected properties.
@example
const newObject = pick({ name: 'test', id: 1 }, ['id']);