Skip to content

Instantly share code, notes, and snippets.

@buymed-hoangpham
Created September 11, 2022 09:10
Show Gist options
  • Save buymed-hoangpham/159c0548fd70ce28110cba9f2b7bffbb to your computer and use it in GitHub Desktop.
Save buymed-hoangpham/159c0548fd70ce28110cba9f2b7bffbb to your computer and use it in GitHub Desktop.
4
const paintings = [
{ name: 'Mona lisa', width: 200, height: 200 },
{ name: 'The scream', width: 400, height: 600 },
{ name: 'The last supper', width: 600, height: 700 },
];
const messages = paintings.reduce((acc, cur) => {
acc.push(`The ${cur.name} is ${cur.width} x ${cur.height}`);
return acc;
}, []);
console.log('🚀 ~ file: index.js ~ line 11 ~ messages ~ messages', messages);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment