Oct 16, 2009

object literal

var myObject = { name: "Jack B. Nimble", 'goto': 'Jail', grade: 'A', level: 3, "3": "three" };
alert(myObject.name);
alert(myObject["name"]);
alert(myObject["goto"]);
alert(myObject.goto); //ok
alert(myObject["3"]);
//alert(myObject.3); //error