Can I create an Array from an Object just in one line? I don't want all the values object, just a selection:
const myObject = { a: 'foo', b: 'bar', c:'yep' }
const { a, c } = myObject
const myArray = Array.of(a, c)
console.log(myArray)
Could I use destructuring in some way inside the Array.of parameter?
Object.keys&Array.mapmethods?myArray=(({a,c})=>[a,c])(myObject)const { a, c } = myObject, myArray = [a, c]. Even an imaginary solution cannot be shorter, so maybe you explain your objective.