Skip to content

Commit 6acc5f5

Browse files
done
1 parent c98ad6e commit 6acc5f5

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

objects-and-math/exercises/ObjectExercises.js

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,63 @@
1+
2+
// After you have created the other object literals, add the astronautID property to each one.
3+
4+
// Add a move method to each animal object
5+
6+
// Create an array to hold the animal objects.
7+
8+
// Print out the relevant information about each animal.
9+
10+
// Start an animal race!
11+
112
let superChimpOne = {
213
name: "Chad",
314
species: "Chimpanzee",
415
mass: 9,
5-
age: 6
16+
age: 6,
17+
astronautID: 1,
18+
move: function () {return Math.floor(Math.random()*11)}
619
};
720

821
let salamander = {
922
name: "Lacey",
1023
species: "Axolotl Salamander",
1124
mass: 0.1,
12-
age: 5
25+
age: 5,
26+
astronautID: 2,
27+
move: function () {return Math.floor(Math.random()*11)}
1328
};
1429

30+
let superChimpTwo = {
31+
name: "Brad",
32+
species: "Chimpanzee",
33+
mass: 11,
34+
age: 6,
35+
astronautID: 3,
36+
move: function () {return Math.floor(Math.random()*11)}
37+
};
1538

16-
// After you have created the other object literals, add the astronautID property to each one.
39+
let dog = {
40+
name: "Leroy",
41+
species: "Beagle",
42+
mass: 14,
43+
age: 5,
44+
astronautID: 4,
45+
move: function () {return Math.floor(Math.random()*11)}
46+
};
1747

18-
// Add a move method to each animal object
48+
let waterBear = {
49+
name: "Almina",
50+
species: "Tardigrade",
51+
mass: 0.0000000001,
52+
age: 1,
53+
astronautID: 5,
54+
move: function () {return Math.floor(Math.random()*11)}
55+
};
1956

20-
// Create an array to hold the animal objects.
2157

22-
// Print out the relevant information about each animal.
58+
let crew = [superChimpOne, superChimpTwo, salamander, dog, waterBear];
59+
2360

24-
// Start an animal race!
2561
function fitnessTest(candidates){
2662
let results = [], numSteps, turns;
2763

0 commit comments

Comments
 (0)