Skip to content

Commit 072d4f8

Browse files
committed
assigmnets
1 parent 2ff1889 commit 072d4f8

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

modules/exercises/ScoreCalcs/averages.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ function averageForTest(testIndex,scores){
1717
}
1818

1919
//TODO: Export all functions within an object.
20+
21+
module.exports = {
22+
averageForStudent: averageForStudent,
23+
averageForTest: averageForTest
24+
};

modules/exercises/display.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ function printTestScores(index,test,students,scores){
3434
}
3535
return;
3636
}
37+
38+
module.exports =
Binary file not shown.

objects-and-math/chapter-examples/ForInLoop.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@ let tortoiseOne = {
66
diet: ["pumpkins", "lettuce", "cabbage"]
77
};
88

9+
for (item in tortoisOne) {
10+
console.log(item + ", " + tortoiseOne[item]);
11+
}
12+
13+
for (let key in tortoiseOne) {
14+
console.log(tortoiseOne[key]);
15+
}
916
// Using a for..in loop, iterate through each property in the tortoiseOne object and print the value to the console.

objects-and-math/studio/ObjectsStudio01.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
// Code your selectRandomEntry function here:
2+
function selectRandomEntry(array){
3+
let index = Math.floor(Math.random()*array.length);
4+
return array[index]
5+
}
26

37

8+
let newArr = [];
9+
while(newArr.length) {
10+
11+
}
12+
413
// Code your buildCrewArray function here:
514

615

716
let idNumbers = [291, 414, 503, 599, 796, 890];
8-
17+
console.log(selectRandomEntry(idNumbers));
918
// Here are the candidates and the 'animals' array:
1019
let candidateA = {
1120
'name':'Gordon Shumway',

0 commit comments

Comments
 (0)