
module("About Objects (topics/about_objects.js)");

test("object type", function() {
    var empty_object = {};
    equal(__, typeof(empty_object), 'what is the type of an object?');
});

test("object literal notation", function() {
    var person = {
        __:__,
        __:__
    };
    equal("Amory Blaine", person.name, "what is the person's name?");
    equal(102, person.age, "what is the person's age?");
});

test("dynamically adding properties", function() {
    var person = {};
    person.__ = "Amory Blaine";
    person.__ = 102;
    equal("Amory Blaine", person.name, "what is the person's name?");
    equal(102, person.age, "what is the person's age?");
}); 

test("adding properties from strings", function() {
    var person = {};
    person["__"] = "Amory Blaine";
    person["__"] = 102;
    equal("Amory Blaine", person.name, "what is the person's name?");
    equal(102, person.age, "what is the person's age?");
});

test("adding functions", function() {
    var person = {
        name: "Amory Blaine",
        age: 102,
        toString: function() {
            return __;  // HINT: use the 'this' keyword to refer to the person object.
        }
    };
    equal("I Amory Blaine am 102 years old.", person.toString(), "what should the toString function be?");
});

@@ -116,18 +116,24 @@
   equal(
-__
+%22object%22
 , typeof
@@ -260,21 +260,35 @@
         
-__:__
+name:%22Amory Blaine%22
 ,%0A      
@@ -293,13 +293,15 @@
     
-__:__
+age:102
 %0A   
@@ -519,18 +519,20 @@
  person.
-__
+name
  = %22Amor
@@ -553,18 +553,19 @@
  person.
-__
+age
  = 102;%0A
@@ -778,26 +778,28 @@
     person%5B%22
-__
+name
 %22%5D = %22Amory 
@@ -819,18 +819,19 @@
 person%5B%22
-__
+age
 %22%5D = 102
@@ -1123,10 +1123,60 @@
 urn 
-__
+%22I %22 + this.name + %22 am %22 + this.age + %22 years old.%22
 ;  /

complete about_objects