title: Property names in JavaScript
body: <p>I have a question that has been really bugging me for quite a while and I cannot seem to find any resources that cover the topic. How can property names in JavaScript be string literals or numeric literals?</p>
  
  <pre><code>var obj = {
      "bar": "foobar",
      "foo": function() { return bar; }
  }
  </code></pre>
  
  <p>This topic has bugged me ever since I learned about it a few years ago. I don't know where to get more in-depth information or what this is even called. I not confused on how this is set up as I know that a new object is being creating with members, bar &amp; foo and then its assigned to the obj variable.</p>
  
  <p>You cannot create a variable like var "bar" = "foobar"; because you'll get a syntax error. How is it valid for object literals? Any help on this would be very much appreciated.</p>