title: Difference between an object and a hash?
body: <p>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?</p>
  
  <pre><code>var kid = {
   name: "juni",
   age: 1
  }
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>var kid = new Object();
  kid.name = "juni";
  kid.age = 1;
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>var kid = new Object();
  kid["name"] = "juni";
  kid["age"] = 1;
  </code></pre>
  
  <p>Can you think of any other code example I should illustrate?</p>
  
  <p>The <em>core question here</em> is <em>what is the difference between an object and a hash?</em></p>