Say I have an object:
elmo = { color: \'red\', annoying: true, height: \'unknown\', meta: { one: \'1\', two: \'2\'} };
I want to m
I am adding this answer because none of the answer used Comma operator.
It's very easy with destructuring assignment and , operator
,
const object = { a: 5, b: 6, c: 7 }; const picked = ({a,c} = object, {a,c}) console.log(picked);