@@ -5,34 +5,34 @@ $(document).ready(function(){
5
5
6
6
test ( "array literal syntax and indexing" , function ( ) {
7
7
var favouriteThings = [ "cellar door" , 42 , true ] ; // note that array elements do not have to be of the same type
8
- equals ( favouriteThings [ 0 ] , __ , 'what is in the first position of the array?' ) ;
9
- equals ( favouriteThings [ 1 ] , __ , 'what is in the second position of the array?' ) ;
10
- equals ( favouriteThings [ 2 ] , __ , 'what is in the third position of the array?' ) ;
8
+ equals ( favouriteThings [ 0 ] , "cellar door" , 'what is in the first position of the array?' ) ;
9
+ equals ( favouriteThings [ 1 ] , 42 , 'what is in the second position of the array?' ) ;
10
+ equals ( favouriteThings [ 2 ] , true , 'what is in the third position of the array?' ) ;
11
11
} ) ;
12
12
13
13
test ( "array type" , function ( ) {
14
- equals ( typeof ( [ ] ) , __ , 'what is the type of an array?' ) ;
14
+ equals ( typeof ( [ ] ) , "object" , 'what is the type of an array?' ) ;
15
15
} ) ;
16
16
17
17
test ( "length" , function ( ) {
18
18
var collection = [ 'a' , 'b' , 'c' ] ;
19
- equals ( collection . length , __ , 'what is the length of the collection array?' ) ;
19
+ equals ( collection . length , 3 , 'what is the length of the collection array?' ) ;
20
20
} ) ;
21
21
22
22
test ( "delete" , function ( ) {
23
23
var daysOfWeek = [ 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' , 'Sunday' ] ;
24
- var workingWeek = daysOfWeek . splice ( __ , __ ) ;
25
- ok ( workingWeek . equalTo ( [ __ ] ) , 'what is the value of workingWeek?' ) ;
26
- ok ( daysOfWeek . equalTo ( [ __ ] ) , 'what is the value of daysOfWeek?' ) ;
24
+ var workingWeek = daysOfWeek . splice ( 0 , 5 ) ;
25
+ ok ( workingWeek . equalTo ( [ 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' ] ) , 'what is the value of workingWeek?' ) ;
26
+ ok ( daysOfWeek . equalTo ( [ 'Saturday' , 'Sunday' ] ) , 'what is the value of daysOfWeek?' ) ;
27
27
} ) ;
28
28
29
29
test ( "stack methods" , function ( ) {
30
30
var stack = [ ] ;
31
31
stack . push ( "first" ) ;
32
32
stack . push ( "second" ) ;
33
33
34
- equals ( stack . pop ( ) , __ , 'what will be the first value poped off the stack?' ) ;
35
- equals ( stack . pop ( ) , __ , 'what will be the second value poped off the stack?' ) ;
34
+ equals ( stack . pop ( ) , 'second' , 'what will be the first value poped off the stack?' ) ;
35
+ equals ( stack . pop ( ) , 'first' , 'what will be the second value poped off the stack?' ) ;
36
36
} ) ;
37
37
38
38
} ) ;
0 commit comments