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?