Skip to content

Commit f4c8497

Browse files
committed
why am I blankin on a for loop???
1 parent 79fe60c commit f4c8497

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

fundamentals.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,38 @@
33
// #1: Create an array of strings called `foods` that contains three foods.
44
// Type your solution immediately below this line:
55

6-
6+
var foods = ["banana","rice","meatloaf"];
77

88
// #2: Access the last item in the array and assign to a variable called `last`.
99
// Type your solution immediately below this line:
1010

11-
11+
var last = foods[2];
1212

1313
// #3: Create an empty array called `favoriteFoods`.
1414
// Type your solution immediately below this line:
1515

16+
var favoriteFoods = [];
1617

1718

1819
// #4: Create a `for` loop that adds each string in `foods` to `favoriteFoods`.
1920
// Type your solution immediately below this line:
20-
21-
21+
for (var i=0; i < foods.length; i++) {
22+
favoriteFoods.push(i)
23+
}
2224

2325
// #5: Create an object literal called `instructor` that contains three key-value pairs.
2426
// Type your solution immediately below this line:
2527

26-
28+
var instructor = {
29+
name: 'Atasha',
30+
age: 37,
31+
hometown: 'Hawaii'
32+
}
2733

2834
// #6: Add a `has-office-hours` (spelled exactly) property to `instructor` by accessing
2935
// it (do not change the original object you typed above) and assigning it
3036
// a boolean value.
3137
// Type your solution immediately below this line:
38+
39+
40+
instructor['has-office-hours'] = true

0 commit comments

Comments
 (0)