File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 3
3
// #1: Create an array of strings called `foods` that contains three foods.
4
4
// Type your solution immediately below this line:
5
5
6
-
6
+ var foods = [ "banana" , "rice" , "meatloaf" ] ;
7
7
8
8
// #2: Access the last item in the array and assign to a variable called `last`.
9
9
// Type your solution immediately below this line:
10
10
11
-
11
+ var last = foods [ 2 ] ;
12
12
13
13
// #3: Create an empty array called `favoriteFoods`.
14
14
// Type your solution immediately below this line:
15
15
16
+ var favoriteFoods = [ ] ;
16
17
17
18
18
19
// #4: Create a `for` loop that adds each string in `foods` to `favoriteFoods`.
19
20
// Type your solution immediately below this line:
20
-
21
-
21
+ for ( var i = 0 ; i < foods . length ; i ++ ) {
22
+ favoriteFoods . push ( i )
23
+ }
22
24
23
25
// #5: Create an object literal called `instructor` that contains three key-value pairs.
24
26
// Type your solution immediately below this line:
25
27
26
-
28
+ var instructor = {
29
+ name : 'Atasha' ,
30
+ age : 37 ,
31
+ hometown : 'Hawaii'
32
+ }
27
33
28
34
// #6: Add a `has-office-hours` (spelled exactly) property to `instructor` by accessing
29
35
// it (do not change the original object you typed above) and assigning it
30
36
// a boolean value.
31
37
// Type your solution immediately below this line:
38
+
39
+
40
+ instructor [ 'has-office-hours' ] = true
You can’t perform that action at this time.
0 commit comments