Here is how i am doing this:
`
var myObject = {name: "Alex Jonathan", age: 41, id: 3};
let {name, age} = myObject
myArray = [{name}, {age}]
`
is there any better way?
You just want the values in the new array or each pairs as an elements?
Обсуждают сегодня