Quick actions

cmd+k|ctrl+k

Navigation

Languages

Kuis Coding: Functional Programming

Snippet info

Language

JavaScript

Visibility

public

Author

ryandfbasketball12

Created

2022-11-01T05:06:31.276352Z

Updated

2022-12-01T03:44:46.472703Z

const books = [
  { title: 'The Da Vinci Code', author: 'Dan Brown', sales: 5094805 },
  { title: 'The Ghost', author: 'Robert Harris', sales: 807311 },
  { title: 'White Teeth', author: 'Zadie Smith', sales: 815586 },
  { title: 'Fifty Shades of Grey', author: 'E. L. James', sales: 3758936 },
  { title: 'Jamie\'s Italy', author: 'Jamie Oliver', sales: 906968 },
  { title: 'I Can Make You Thin', author: 'Paul McKenna', sales: 905086 },
  { title: 'Harry Potter and the Deathly Hallows', author: 'J.K Rowling', sales: 4475152 },
];

const greatAuthors = books.filter((book) => book.sales > 1000000).map((book) => {
    const {author, title} = book;
	return `${author} adalah penulis buku ${title} yang sangat hebat!`
}) ;

console.log(greatAuthors);
INFO