-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise-5.js
More file actions
44 lines (39 loc) · 864 Bytes
/
exercise-5.js
File metadata and controls
44 lines (39 loc) · 864 Bytes
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
/* Challenge Famous Writers
Did you know you can also have an array of objects? We've created one for you here. Loop through the array,
and for each object, `console.log()` out the sentence:
"Hi, my name is {firstName} {lastName}. I am {age} years old, and work as a {occupation}."
Here is the array:
*/
var writers = [
{
firstName: "Virginia",
lastName: "Woolf",
occupation: "writer",
age: 59,
alive: false
},
{
firstName: "Zadie",
lastName: "Smith",
occupation: "writer",
age: 41,
alive: true
},
{
firstName: "Jane",
lastName: "Austen",
occupation: "writer",
age: 41,
alive: false
},
{
firstName: "bell",
lastName: "hooks",
occupation: "writer",
age: 64,
alive: true
},
];
/*
If you want an extra challenge, only `console.log()` the writers that are alive.
*/