@@ -16,6 +16,8 @@ let quantity = item[2];
1616
1717// Change above this line
1818
19+ // ---------------------------------------------------------------------
20+
1921/*
2022Exercise 2
2123
@@ -31,17 +33,46 @@ let [one, two, three, four, five, six] = numbers;
3133
3234// Change above this line
3335
36+ // ---------------------------------------------------------------------
37+
3438/**
35- Exercise 3
39+ Exercise 3a
3640
37- We have an object called 'user '.
41+ We have an object called 'john '.
3842Write the destructuring assignment that reads:
39- - 'name' property into the variable 'name '.
40- - 'years' property into the variable 'age '.
41- - 'isAdmin' property into the variable 'isAdmin' (false, if no such property)
43+ - 'name' property into the variable 'johnName '.
44+ - 'years' property into the variable 'johnAge '.
45+ - 'isAdmin' property into the variable 'isJohnAdmin'
4246*/
4347
48+ let john = { name : "John" , years : 30 , isAdmin : true } ;
49+
50+ // Change below this line
51+
52+ let johnName = john . name
53+ let johnAge = john . years
54+ let isJohnAdmin = john . isAdmin
55+
56+ // Change above this line
57+
4458
59+ // Exercise 3b
60+
61+ // We have an object called 'steve'. Similiar as before
62+ // 'name' property into the variable 'steveName'.
63+ // - 'years' property into the variable 'steveAge'.
64+ // - 'isAdmin' property into the variable 'isSteveAdmin' (false, if no such property)
65+
66+ let steve = { name : "Steve" , years : 25 } ;
67+
68+ // Change below this line
69+
70+ let steveName = steve . name
71+ let steveAge = steve . years
72+ let isSteveAdmin = steve . isAdmin
73+
74+ // Change above this line
4575
76+ // ---------------------------------------------------------------------
4677
47- module . exports = { name, quantity, price, one, two, three, four, five, six }
78+ module . exports = { name, quantity, price, one, two, three, four, five, six, johnName , johnAge , isJohnAdmin , steveName , steveAge , isSteveAdmin }
0 commit comments