diff --git a/getTheTitles/getTheTitles.js b/getTheTitles/getTheTitles.js index 13b5cf6..df0916b 100644 --- a/getTheTitles/getTheTitles.js +++ b/getTheTitles/getTheTitles.js @@ -1,11 +1,7 @@ const getTheTitles = function(books) { - let bookTitles = []; + const mappedBooks = books.map(book => book.title); - books.forEach((book) => { - bookTitles.push(book.title); - }) - - return bookTitles; + return mappedBooks; } module.exports = getTheTitles;