So, what i have:
const obj = { a: 1, b: 2, c: 3 };
const { a, c } = obj;
const newObj = { a, c };
//newObj is { a: 1, c: 3 } now
What i kinda want to have:
const newObj = { a, c } = obj
//newObj is { a: 1, c: 3 } now
Looks much cleaner for big objects (but dont work, obviously). Any ideas?
Summary: lodash.pick mentioned by @wostex is best solution for now