728x90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let john = { name: "John", age: 25 }; | |
let pete = { name: "Pete", age: 30 }; | |
let mary = { name: "Mary", age: 28 }; | |
let users = [ john, pete, mary ]; | |
let names = users.map(user => user.name); | |
console.log( names ); // John, Pete, Mary |
'Algorithm > JavaScript(Node.js)' 카테고리의 다른 글
The Modern JS Tutorial: array-methods: sort users by age (0) | 2021.09.20 |
---|---|
The Modern JS Tutorial: array-methods: map to objects (0) | 2021.09.20 |
The Modern JS Tutorial: array-methods: calculator (0) | 2021.09.20 |
The Modern JS Tutorial: array-methods: filterRangeInPlace (0) | 2021.09.13 |
The Modern JS Tutorial: array-methods: filterRange (0) | 2021.09.13 |