Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61b93b0

Browse files
committed
Solve forth question
1 parent e7a363d commit 61b93b0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Keep track of which books you read and which books you want to read!
3-
*
3+
*
44
* Follow the steps:
55
* Declare a variable that holds an array of 3 objects, where each object describes a book and has properties for the title (string), author (string), and alreadyRead (boolean indicating if you read it yet).
66
* Loop through the array of books.
@@ -9,3 +9,18 @@
99
* If you haven't read it log a string like You still need to read "The Lord of the Rings"
1010
*/
1111

12+
const readingList = [
13+
{ title: 'To Kill a Mockingbird', author: 'Harper Lee', alreadyRead: true },
14+
{ title: '1984', author: 'George Orwell', alreadyRead: false },
15+
{ title: 'Moby Dick', author: 'Herman Melville', alreadyRead: true },
16+
];
17+
18+
readingList.forEach((book) => {
19+
console.log(
20+
`${book.title} by ${book.author} , ${
21+
book.alreadyRead
22+
? `You already read ${book.title}`
23+
: ` I still need to read ${book.title}`
24+
} `
25+
);
26+
});

0 commit comments

Comments
 (0)