title: How javascript allows object key type syntax without including ir inside a literal and also variable declaration inside it?
body: <p>While running these statement in chrome console or inside script tag what I found is that the below syntax which I thought is invalid is working and all the varaibles were exposed globally which I understand could be due to curly braces are interpreted as block but that key: in front is what confuse me. But I am not sure why and looking for an explaination.</p>
  
  <pre><code>    foo: {
        a = 5,
        b = 6
      }
  
      console.log(a) output ---&gt;  5
      console.log(b) output ---&gt;  6
  
  
      foo: {
        a = 5;
        b = 6;
      }
  
      console.log(a) output ---&gt;  5
      console.log(b) output ---&gt;  6
  
  
      foo: {
        a: 5;
        b: 6;
      }
  
      console.log(a) output ---&gt;  5
      console.log(b) output ---&gt;  6
  
  </code></pre>