3
rated 0 times
[
9]
[
6]
/ answers: 1 / hits: 23611
/ 15 Years ago, fri, july 17, 2009, 12:00:00
In JavaScript, what is the difference between an object and a hash? How do you create one vs the other, and why would you care? Is there a difference between the following code examples?
var kid = {
name: juni,
age: 1
}
And:
var kid = new Object();
kid.name = juni;
kid.age = 1;
And:
var kid = new Object();
kid[name] = juni;
kid[age] = 1;
Can you think of any other code example I should illustrate?
The core question here is what is the difference between an object and a hash?
More From » json