From 6046cee9cd16bc71ff16b114fad74b1ffd56f140 Mon Sep 17 00:00:00 2001 From: reddforman Date: Thu, 17 Nov 2022 10:16:52 -0800 Subject: [PATCH] Add files via upload --- 11_getTheTitles/getTheTitles.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/11_getTheTitles/getTheTitles.js b/11_getTheTitles/getTheTitles.js index 74b04df..2ce709f 100644 --- a/11_getTheTitles/getTheTitles.js +++ b/11_getTheTitles/getTheTitles.js @@ -1,6 +1,16 @@ -const getTheTitles = function() { - -}; +const getTheTitles = function(books) { + bookOne = books[0].title; + bookTwo = books[1].title; + const bookArray = [bookOne, bookTwo] + return bookArray; +} // Do not edit below this line module.exports = getTheTitles; + + +/* +const getTheTitles = function(array) { + return array.map(book => book.title); +}; +*/ \ No newline at end of file