@@ -5,30 +5,30 @@ $(document).ready(function(){
5
5
6
6
test ( "object type" , function ( ) {
7
7
var empty_object = { } ;
8
- equals ( typeof ( empty_object ) , __ , 'what is the type of an object?' ) ;
8
+ equals ( typeof ( empty_object ) , "object" , 'what is the type of an object?' ) ;
9
9
} ) ;
10
10
11
11
test ( "object literal notation" , function ( ) {
12
12
var person = {
13
- __ : __ ,
14
- __ : __
13
+ name : "Amory Blaine" ,
14
+ age : 102
15
15
} ;
16
16
equals ( person . name , "Amory Blaine" , 'what is the person\'s name?' ) ;
17
17
equals ( person . age , 102 , 'what is the person\'s age?' ) ;
18
18
} ) ;
19
19
20
20
test ( "dynamically adding properties" , function ( ) {
21
21
var person = { } ;
22
- person . __ = "Amory Blaine" ;
23
- person . __ = 102 ;
22
+ person . name = "Amory Blaine" ;
23
+ person . age = 102 ;
24
24
equals ( person . name , "Amory Blaine" , 'what is the person\'s name?' ) ;
25
25
equals ( person . age , 102 , 'what is the person\'s age?' ) ;
26
26
} ) ;
27
27
28
28
test ( "adding properties from strings" , function ( ) {
29
29
var person = { } ;
30
- person [ "__ " ] = "Amory Blaine" ;
31
- person [ "__ " ] = 102 ;
30
+ person [ "name " ] = "Amory Blaine" ;
31
+ person [ "age " ] = 102 ;
32
32
equals ( person . name , "Amory Blaine" , 'what is the person\'s name?' ) ;
33
33
equals ( person . age , 102 , 'what is the person\'s age?' ) ;
34
34
} ) ;
@@ -38,7 +38,7 @@ $(document).ready(function(){
38
38
name : "Amory Blaine" ,
39
39
age : 102 ,
40
40
toString : function ( ) {
41
- return __ ; // HINT: use the 'this' keyword to refer to the person object.
41
+ return "I " + this . name + " am " + this . age + " years old." ; // HINT: use the 'this' keyword to refer to the person object.
42
42
}
43
43
} ;
44
44
equals ( person . toString ( ) , "I Amory Blaine am 102 years old." , 'what should the toString function be?' ) ;
0 commit comments