SyntaxFix
Write A Post
Hire A Developer
Questions
The ES6 way:
let people = [{firstName:'Alice',lastName:'Cooper'},{firstName:'Bob',age:'Dylan'}]; let names = Array.from(people, p => p.firstName); for (let name of names) { console.log(name); }
also at: https://jsfiddle.net/52dpucey/