title: Referencing object's property name with hyphen
body: <p>I have defined an object with properties that have hyphen in their names.</p>
  
  <pre><code>var data = {
    "foo-bar": "value",
    "this-that": "another value"
  }
  </code></pre>
  
  <p>Now I need to reference this property in JS, but both these ways result in syntax error.</p>
  
  <pre><code>console.log( data.foo-bar )
  </code></pre>
  
  <p>and</p>
  
  <pre><code>console.log( data."foo-bar" )
  </code></pre>
  
  <p>So my question is. How can I access a property that contains hyphen in the name in JS?</p>
  
  <hr>
  
  <p><em>Disclaimer: The server-side functionality require hyphen-naming of the properties and I don't really feel like rewriting somebody else's whole script that takes the input params like this. And yes, I know this current way is not the most clean approach possible.</em></p>