If you want something you've never had, you must be willing to do something you've never done!

Powered by Blogger.

JavaScript Objects : Hash (Associative Array) 0

Cerita Semalam Aaz | 8:24 PM | ,


JavaScript Object is an Associative
Array (Hash)

•  A JavaScript object is essentially an associative array (hash)
with fields and methods, which are keyed by name
{firstname: "John", lastname: "Doe", age: 50,
tellYourage: function () {
alert(“The age is + this.age );
},
tellSomething: function(something) {
alert(something);
}
}

The following two lines of code are semantically equivalent
myObject.myfield = “something”;
myObject['myfield'] = “something”;


SEE VIDEO

0 Responses So Far:

Related Post

 
Back To Top