From 4fba21edb12d59db913b5abbeacd530cf7620ba4 Mon Sep 17 00:00:00 2001 From: Julian So <37486854+julianchso@users.noreply.github.com> Date: Sat, 14 Jan 2023 11:12:15 -0500 Subject: [PATCH] Update getTheTitles.js added solution --- 11_getTheTitles/getTheTitles.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/11_getTheTitles/getTheTitles.js b/11_getTheTitles/getTheTitles.js index 74b04df..e7b861e 100644 --- a/11_getTheTitles/getTheTitles.js +++ b/11_getTheTitles/getTheTitles.js @@ -1,5 +1,21 @@ -const getTheTitles = function() { +const getTheTitles = function () { + const books = [ + { + title: "Book", + author: "Name", + }, + { + title: "Book2", + author: "Name2", + }, + ]; + let titles = []; + + books.forEach((book) => { + titles.push(book.title); + }); + return titles; }; // Do not edit below this line