-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.js
48 lines (34 loc) · 1.5 KB
/
index.js
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
const farmAnimals = 'cow horse sheep pig chicken';
const colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'];
const muppet = {
muppetName: 'Miss Piggy',
color: 'pink',
song: 'Never Before, Never Again',
job: 'Cast member of The Muppet Show',
partner: 'Kermit'
};
const nestedMuppet = {
nestedName: 'Kermit',
nestedColor: 'green',
album: {
theMuppetMovie: {
song1: 'Rainbow Connection',
song2: 'Moving Right Along',
song3: 'Never Before, Never Again',
song4: 'I Hope That Something Better Comes Along',
},
},
nestedJob: 'Host of The Muppet Show',
nestedPartner: 'Miss Piggy'
};
// Strings
// 1. Use destructuring to assign appropriate variables based on the sounds animals make.
// 2. Bolt the horse wandered off, so just give us four animals, and let's name them bessie, dolly, babe, and little.
// 3. Little the chicken had to go back to the coop, so now we're left with three. Let's use color variables of blackAndWhite, black, and pink.
// Arrays
// 4. Use destructuring to assign appropriate variables using the color names.
// 5. Some people have a really hard time picking out indigo, so let's leave that one out, using the first letter of each color as the variable names.
// 6. But wait! Indigo is now feeling *super* left out. Let's only assign indigo using indg.
// Objects
// 7. Use destructuring to assign all variables using the keys as the variable names
// 8. Use destructuring to assign songs 2 and 4, and Kermit's job and partner