JSFiddle - React, Tailwind, and code Playground

by dmitri_pavlutin

JavaScript

const heroes = [
  { name: 'Batman' },
  { name: 'Joker' }
];

const names = heroes.map(
  function({ name }) {
    return name;
  }
);

console.log(names); // => ['Batman', 'Joker']