Source Code:
(back to article)
Submit
Result:
Report an issue
const myArray = [{x:100}, {x:200}, {x:300}]; const newArray= myArray.map(element => element.x); console.log(newArray); // [100, 200, 300]