1
+ let steps = 0
2
+
1
3
let superChimpOne = {
2
4
name : "Chad" ,
3
5
species : "Chimpanzee" ,
@@ -9,14 +11,61 @@ let salamander = {
9
11
name : "Lacey" ,
10
12
species : "Axolotl Salamander" ,
11
13
mass : 0.1 ,
12
- age : 5
14
+ age : 5 ,
15
+ move : function ( steps ) {
16
+ return Math . floor ( Math . random ( steps ) * 11 )
17
+ }
18
+ } ;
19
+
20
+ let superChimpTwo = {
21
+ name : "Brad" ,
22
+ species : "Chipanzee" ,
23
+ mass : 11 ,
24
+ age : 6 ,
25
+ move : function ( ) {
26
+ return Math . floor ( Math . random ( ) * 11 )
27
+ }
28
+ } ;
29
+
30
+ let beagleBoy = {
31
+ name : "Leroy" ,
32
+ species : "Beagle" ,
33
+ mass : 14 ,
34
+ age : 5 ,
35
+ move : function ( ) {
36
+ return Math . floor ( Math . random ( ) * 11 )
37
+ }
13
38
} ;
14
39
40
+ let tardy = {
41
+ name : "Almina" ,
42
+ species : "Tardigrade" ,
43
+ mass : 0.0000000001 ,
44
+ age : 1 ,
45
+ move : function ( ) {
46
+ return Math . floor ( Math . random ( ) * 11 )
47
+ }
48
+ } ;
49
+ console . log ( superChimpOne ) ;
15
50
16
51
// After you have created the other object literals, add the astronautID property to each one.
52
+ superChimpOne [ 'astronautID' ] = 3 ;
53
+ superChimpTwo [ 'astronautID' ] = 4 ;
54
+ salamander [ 'astronautID' ] = 6 ;
55
+ beagleBoy [ 'astronautID' ] = 7 ;
56
+ tardy [ 'astronautID' ] = 9 ;
17
57
18
- // Create an array to hold the animal objects.
58
+ superChimpOne [ 'move' ] = function ( steps ) { return ( Math . floor ( Math . random ( steps ) * 11 ) ) } ;
19
59
60
+ // Create an array to hold the animal objects.
61
+ crew = [ superChimpOne , superChimpTwo , salamander , beagleBoy , tardy ]
20
62
// Print out the relevant information about each animal.
21
63
22
- // Start an animal race!
64
+ // Start an animal race!
65
+
66
+ function crewReports ( crew ) {
67
+ return ( `${ crew . name } is a ${ crew . species } . They are ${ crew . age } years old and ${ crew . mass } kilograms. Their ID is ${ crew . astronautID } .` )
68
+ }
69
+ console . log ( crewReports ( crew [ 2 ] ) )
70
+
71
+ function fitnessTest ( candidates ) { }
0 commit comments