@@ -3,16 +3,16 @@ describe("About Arrays", function() {
33 //We shall contemplate truth by testing reality, via spec expectations.
44 it ( "should create arrays" , function ( ) {
55 var emptyArray = [ ] ;
6- expect ( typeof ( emptyArray ) ) . toBe ( __ ) ; //A mistake? - http:javascript.crockford.com/remedial.html
7- expect ( emptyArray . length ) . toBe ( __ ) ;
6+ expect ( typeof ( emptyArray ) ) . toBe ( FILL_ME_IN ) ; //A mistake? - http:javascript.crockford.com/remedial.html
7+ expect ( emptyArray . length ) . toBe ( FILL_ME_IN ) ;
88
99 var multiTypeArray = [ 0 , 1 , "two" , function ( ) { return 3 ; } , { value1 : 4 , value2 : 5 } , [ 6 , 7 ] ] ;
10- expect ( multiTypeArray [ 0 ] ) . toBe ( __ ) ;
11- expect ( multiTypeArray [ 2 ] ) . toBe ( __ ) ;
12- expect ( multiTypeArray [ 3 ] ( ) ) . toBe ( __ ) ;
13- expect ( multiTypeArray [ 4 ] . value1 ) . toBe ( __ ) ;
14- expect ( multiTypeArray [ 4 ] [ "value2" ] ) . toBe ( __ ) ;
15- expect ( multiTypeArray [ 5 ] [ 0 ] ) . toBe ( __ ) ;
10+ expect ( multiTypeArray [ 0 ] ) . toBe ( FILL_ME_IN ) ;
11+ expect ( multiTypeArray [ 2 ] ) . toBe ( FILL_ME_IN ) ;
12+ expect ( multiTypeArray [ 3 ] ( ) ) . toBe ( FILL_ME_IN ) ;
13+ expect ( multiTypeArray [ 4 ] . value1 ) . toBe ( FILL_ME_IN ) ;
14+ expect ( multiTypeArray [ 4 ] [ "value2" ] ) . toBe ( FILL_ME_IN ) ;
15+ expect ( multiTypeArray [ 5 ] [ 0 ] ) . toBe ( FILL_ME_IN ) ;
1616 } ) ;
1717
1818 it ( "should understand array literals" , function ( ) {
@@ -23,36 +23,36 @@ describe("About Arrays", function() {
2323 expect ( array ) . toEqual ( [ 1 ] ) ;
2424
2525 array [ 1 ] = 2 ;
26- expect ( array ) . toEqual ( [ 1 , __ ] ) ;
26+ expect ( array ) . toEqual ( [ 1 , FILL_ME_IN ] ) ;
2727
2828 array . push ( 3 ) ;
29- expect ( array ) . toEqual ( __ ) ;
29+ expect ( array ) . toEqual ( FILL_ME_IN ) ;
3030 } ) ;
3131
3232 it ( "should understand array length" , function ( ) {
3333 var fourNumberArray = [ 1 , 2 , 3 , 4 ] ;
3434
35- expect ( fourNumberArray . length ) . toBe ( __ ) ;
35+ expect ( fourNumberArray . length ) . toBe ( FILL_ME_IN ) ;
3636 fourNumberArray . push ( 5 , 6 ) ;
37- expect ( fourNumberArray . length ) . toBe ( __ ) ;
37+ expect ( fourNumberArray . length ) . toBe ( FILL_ME_IN ) ;
3838
3939 var tenEmptyElementArray = new Array ( 10 ) ;
40- expect ( tenEmptyElementArray . length ) . toBe ( __ ) ;
40+ expect ( tenEmptyElementArray . length ) . toBe ( FILL_ME_IN ) ;
4141
4242 tenEmptyElementArray . length = 5 ;
43- expect ( tenEmptyElementArray . length ) . toBe ( __ ) ;
43+ expect ( tenEmptyElementArray . length ) . toBe ( FILL_ME_IN ) ;
4444 } ) ;
4545
4646 it ( "should slice arrays" , function ( ) {
4747 var array = [ "peanut" , "butter" , "and" , "jelly" ] ;
4848
49- expect ( array . slice ( 0 , 1 ) ) . toEqual ( __ ) ;
50- expect ( array . slice ( 0 , 2 ) ) . toEqual ( __ ) ;
51- expect ( array . slice ( 2 , 2 ) ) . toEqual ( __ ) ;
52- expect ( array . slice ( 2 , 20 ) ) . toEqual ( __ ) ;
53- expect ( array . slice ( 3 , 0 ) ) . toEqual ( __ ) ;
54- expect ( array . slice ( 3 , 100 ) ) . toEqual ( __ ) ;
55- expect ( array . slice ( 5 , 1 ) ) . toEqual ( __ ) ;
49+ expect ( array . slice ( 0 , 1 ) ) . toEqual ( FILL_ME_IN ) ;
50+ expect ( array . slice ( 0 , 2 ) ) . toEqual ( FILL_ME_IN ) ;
51+ expect ( array . slice ( 2 , 2 ) ) . toEqual ( FILL_ME_IN ) ;
52+ expect ( array . slice ( 2 , 20 ) ) . toEqual ( FILL_ME_IN ) ;
53+ expect ( array . slice ( 3 , 0 ) ) . toEqual ( FILL_ME_IN ) ;
54+ expect ( array . slice ( 3 , 100 ) ) . toEqual ( FILL_ME_IN ) ;
55+ expect ( array . slice ( 5 , 1 ) ) . toEqual ( FILL_ME_IN ) ;
5656 } ) ;
5757
5858 it ( "should know array references" , function ( ) {
@@ -62,36 +62,36 @@ describe("About Arrays", function() {
6262 refArray [ 1 ] = "changed in function" ;
6363 }
6464 passedByReference ( array ) ;
65- expect ( array [ 1 ] ) . toBe ( __ ) ;
65+ expect ( array [ 1 ] ) . toBe ( FILL_ME_IN ) ;
6666
6767 var assignedArray = array ;
6868 assignedArray [ 5 ] = "changed in assignedArray" ;
69- expect ( array [ 5 ] ) . toBe ( __ ) ;
69+ expect ( array [ 5 ] ) . toBe ( FILL_ME_IN ) ;
7070
7171 var copyOfArray = array . slice ( ) ;
7272 copyOfArray [ 3 ] = "changed in copyOfArray" ;
73- expect ( array [ 3 ] ) . toBe ( __ ) ;
73+ expect ( array [ 3 ] ) . toBe ( FILL_ME_IN ) ;
7474 } ) ;
7575
7676 it ( "should push and pop" , function ( ) {
7777 var array = [ 1 , 2 ] ;
7878 array . push ( 3 ) ;
7979
80- expect ( array ) . toEqual ( __ ) ;
80+ expect ( array ) . toEqual ( FILL_ME_IN ) ;
8181
8282 var poppedValue = array . pop ( ) ;
83- expect ( poppedValue ) . toBe ( __ ) ;
84- expect ( array ) . toEqual ( __ ) ;
83+ expect ( poppedValue ) . toBe ( FILL_ME_IN ) ;
84+ expect ( array ) . toEqual ( FILL_ME_IN ) ;
8585 } ) ;
8686
8787 it ( "should know about shifting arrays" , function ( ) {
8888 var array = [ 1 , 2 ] ;
8989
9090 array . unshift ( 3 ) ;
91- expect ( array ) . toEqual ( __ ) ;
91+ expect ( array ) . toEqual ( FILL_ME_IN ) ;
9292
9393 var shiftedValue = array . shift ( ) ;
94- expect ( shiftedValue ) . toEqual ( __ ) ;
95- expect ( array ) . toEqual ( __ ) ;
94+ expect ( shiftedValue ) . toEqual ( FILL_ME_IN ) ;
95+ expect ( array ) . toEqual ( FILL_ME_IN ) ;
9696 } ) ;
9797} ) ;
0 commit comments