forked from imyagnesh/ReactTraining_29_10_20
-
Notifications
You must be signed in to change notification settings - Fork 0
/
excersise2.txt
29 lines (25 loc) · 933 Bytes
/
excersise2.txt
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
function getAddress() {
return {
city: 'Salt Lake City',
state: 'UT',
zip: 84115,
coords: {
lat: 40.776608,
long: -111.920485,
},
}
}
function getNumbers() {
return [1, 2, 3, 4, 5, 6]
}
function getNestedNumbers() {
return [1, 2, [3, 4, [5, 6]]]
}
1. Using destructuring, call `getAddress()` and create a 'city', 'state' and 'zip' variable.
2. Using destructuring, call `getAddress()` and create an 'address' variable.
3. Using destructuring, call `getAddress()` and pull the city, state and zip out, and alias them to c, s, z, respectively
4. Using destructuring, call `getAddress()` and create `lat` and `long` variables.
5. Call getNumbers and pull the first value out as `one` and the second as `two`
6. Call getNumbers and pull the first value out as `one` and the third as `three`
7. Call getNestedNumbers and pull the first value out as `one`, the 3 as `three` and 6 as `six`.
8.