const array = [1, 2, 3, 4, 5]
function squareNumber(num) {
const squared = array.map(squareNumber)
squared // [1, 4, 9, 16, 25]
const doubled = array.map(num => num * 2); // [2, 4, 6, 8, 10]
name: "JavaScript: The Definitive Guide",
description: `Since 1996, JavaScript: The Definitive Guide...`,
name: "Eloquent JavaScript",
description: `JavaScript lies at the heart...`,
name: "JavaScript: The Good Parts",
description: `Most programming languages...`,
const getTitle = book => book.name;
const titles = books.map(getTitle);
const titlesOfExpensiveBooks = books
.filter(book => book.pirce > 20)