-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercises.js
More file actions
104 lines (92 loc) · 2.34 KB
/
exercises.js
File metadata and controls
104 lines (92 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
*
* For each of the names in the array passed into this function
*
* - Add a <h1> tag to the website containing the name of the person
* - Add a <h2> tag to the website containing the job of the person
*
* All of your HTML should go inside the Div tag with the id "content".
*
* <div id="content">
* <h1>{Name Here}</h1>
* <h2>{Job Here}</h2>
* .....
* </div>
*/
function exerciseOne(arrayOfPeople) {
let content = document.querySelector("#content");
}
/**
*
* Create a list of shopping items. You should use an unordered list.
*
* All of your HTML should go inside the Div tag with the id "content".
*
*/
function exerciseTwo(shopping) {
//Write your code in here
}
/**
I'd like to display my three favorite books inside a nice webpage!
const books = [
{
title: "The Design of Everyday Things",
author: "Don Norman",
alreadyRead: false
},
{
title: "The Most Human Human",
author: "Brian Christian",
alreadyRead: true
},
{
title: "The Pragmatic Programmer",
author: "Andrew Hunt",
alreadyRead: true
}
];
Iterate through the array of books.
- For each book, create a <p> element with the book title and author and append it to the page.
- Use a <ul> and <li> to display the books.
- Add an <img> to each book that links to a URL of the book cover.
- Change the style of the book depending on whether you have read it (green) or not (red).
The end result should look something like this: https://hyf-js2-week1-makeme-ex1-demo.herokuapp.com/
**/
function exerciseThree(books) {
//Write your code in here
}
//
//
//
//
// DO NOT EDIT BELOW HERE
//
//
//
//
let people = [
{ name: "Chris", job: "Teacher" },
{ name: "Joanna", job: "Student" },
{ name: "Boris", job: "Prime Minister" }
];
exerciseOne(people);
let shopping = ["Milk", "Break", "Eggs", "A Dinosaur", "Cake", "Sugar", "Tea"];
exerciseTwo(shopping);
const books = [
{
title: "The Design of Everyday Things",
author: "Don Norman",
alreadyRead: false
},
{
title: "The Most Human Human",
author: "Brian Christian",
alreadyRead: true
},
{
title: "The Pragmatic Programmer",
author: "Andrew Hunt",
alreadyRead: true
}
];
exerciseThree(books);