barbiturat
7/31/2017 - 7:37 PM

Make an object out of keys, with values derived from them

Make an object out of keys, with values derived from them

const source = {
  some: 111,
  other: 222,
  third: 333
};

const objFromKeys = converge(zipObj, [nthArg(1), map])
const getter = prop(__, source);

objFromKeys(getter, ['some', 'third']); //=> {"some": 111, "third": 333}