Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit c961049

Browse files
committed
Add project exercises
1 parent c70fbb6 commit c961049

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
3+
The Recipe Card
4+
Never forget another recipe!
5+
6+
Create an object to hold information on your favorite recipe.
7+
8+
It should have properties for
9+
10+
- Title (a string),
11+
- Servings (a number), and
12+
- Ingredients (an array of strings)
13+
14+
On separate lines (one console.log statement for each), log the recipe information so it looks like:
15+
16+
Mole
17+
Serves: 2
18+
Ingredients:
19+
cinnamon
20+
cumin
21+
cocoa
22+
23+
**/
24+
25+
let recipes = {};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
3+
The Reading List
4+
Keep track of which books you read and which books you want to read!
5+
6+
=====
7+
Exercise 1
8+
=====
9+
Create an array of objects, where each object describes a book and has properties for:
10+
11+
- The title (a string)
12+
- Author (a string)
13+
- and alreadyRead (a boolean indicating if you read it yet)
14+
15+
Loop through the array of books. For each book, log the book title and book author like so:
16+
17+
"The Hobbit by J.R.R. Tolkien"
18+
19+
=====
20+
Exercise 2
21+
=====
22+
Now use an if/else statement to change the output depending on whether you read it yet or not.
23+
24+
If you read it, log a string like 'You already read "The Hobbit" by J.R.R. Tolkien', and if not, log a string like 'You still need to read "The Lord of the Rings" by J.R.R. Tolkien.'
25+
26+
**/
27+
28+
let books = [];

0 commit comments

Comments
 (0)