@@ -4,10 +4,10 @@ $(document).ready(function(){
4
4
module ( "About Reflection (topics/about_reflection.js)" ) ;
5
5
6
6
test ( "typeof" , function ( ) {
7
- equals ( typeof ( { } ) , __ , 'what is the type of an empty object?' ) ;
8
- equals ( typeof ( 'apple' ) , __ , 'what is the type of a string?' ) ;
9
- equals ( typeof ( - 5 ) , __ , 'what is the type of -5?' ) ;
10
- equals ( typeof ( false ) , __ , 'what is the type of false?' ) ;
7
+ equals ( typeof ( { } ) , "object" , 'what is the type of an empty object?' ) ;
8
+ equals ( typeof ( 'apple' ) , "string" , 'what is the type of a string?' ) ;
9
+ equals ( typeof ( - 5 ) , "number" , 'what is the type of -5?' ) ;
10
+ equals ( typeof ( false ) , "boolean" , 'what is the type of false?' ) ;
11
11
} ) ;
12
12
13
13
test ( "property enumeration" , function ( ) {
@@ -18,8 +18,8 @@ $(document).ready(function(){
18
18
keys . push ( propertyName ) ;
19
19
values . push ( person [ propertyName ] ) ;
20
20
}
21
- ok ( keys . equalTo ( [ '__ ' , '__ ' , '__ ' ] ) , 'what are the property names of the object?' ) ;
22
- ok ( values . equalTo ( [ '__' , __ , __ ] ) , 'what are the property values of the object?' ) ;
21
+ ok ( keys . equalTo ( [ 'name ' , 'age ' , 'unemployed ' ] ) , 'what are the property names of the object?' ) ;
22
+ ok ( values . equalTo ( [ 'Amory Blaine' , 102 , true ] ) , 'what are the property values of the object?' ) ;
23
23
} ) ;
24
24
25
25
test ( "hasOwnProperty" , function ( ) {
@@ -31,22 +31,22 @@ $(document).ready(function(){
31
31
for ( propertyName in fruits ) {
32
32
keys . push ( propertyName ) ;
33
33
}
34
- ok ( keys . equalTo ( [ '__ ' , '__ ' , '__ ' ] ) , 'what are the properties of the array?' ) ;
34
+ ok ( keys . equalTo ( [ '0 ' , '1 ' , 'equalTo ' ] ) , 'what are the properties of the array?' ) ;
35
35
36
36
var ownKeys = [ ] ;
37
37
for ( propertyName in fruits ) {
38
38
if ( fruits . hasOwnProperty ( propertyName ) ) {
39
39
ownKeys . push ( propertyName ) ;
40
40
}
41
41
}
42
- ok ( ownKeys . equalTo ( [ '__ ' , '__ ' ] ) , 'what are the own properties of the array?' ) ;
42
+ ok ( ownKeys . equalTo ( [ '0 ' , '1 ' ] ) , 'what are the own properties of the array?' ) ;
43
43
} ) ;
44
44
45
45
test ( "eval" , function ( ) {
46
46
// eval executes a string
47
47
var result = "" ;
48
48
eval ( "result = 'apple' + ' ' + 'pie'" ) ;
49
- equals ( result , __ , 'what is the value of result?' ) ;
49
+ equals ( result , 'apple pie' , 'what is the value of result?' ) ;
50
50
} ) ;
51
51
52
52
} ) ;
0 commit comments