Created
January 24, 2023 08:21
-
-
Save Prosen-Ghosh/4afde2244508f3fde658aec4e5ea1593 to your computer and use it in GitHub Desktop.
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
const users = [ | |
{ name: "Alice", age: 25 }, | |
{ name: "Bob", age: 30 }, | |
{ name: "Charlie", age: 35 } | |
]; | |
const names = users.reduce((acc, {name}) => acc.concat(name), []); | |
console.log(names); | |
// Output: ["Alice", "Bob", "Charlie"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment