Skip to content

Instantly share code, notes, and snippets.

@Prosen-Ghosh
Created January 24, 2023 08:20
Show Gist options
  • Save Prosen-Ghosh/cabfc0ef28404aa376dbce59fa7bca33 to your computer and use it in GitHub Desktop.
Save Prosen-Ghosh/cabfc0ef28404aa376dbce59fa7bca33 to your computer and use it in GitHub Desktop.
const users = [
{ name: "Alice", age: 25 },
{ name: "Bob", age: 30 },
{ name: "Charlie", age: 35 }
];
const names = users.map(user => user.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