title: Getting a Custom Objects properties by string var
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4255472/javascript-object-access-variable-property-name">javascript object, access variable property name?</a>  </p>
  </blockquote>
  
  
  
  <p>Trying to get more advanced in my JS...</p>
  
  <p>I have a custom object:</p>
  
  <pre><code>Object myObject = new Object();
  
  myObject.thing = anythingHere;
  </code></pre>
  
  <p>I would like to be able to retrieve a custom objects property by passing in a string... eg:</p>
  
  <pre><code>var propertyString = 'thing';
  alert(myObject.propertyString);
  </code></pre>
  
  <p>I can't quite figure that out. I've looked at a number of tutorials for custom objects - but nothing shows how to get properties that I don't know the names of... Also - I would like to avoid looping through all properties if possible...</p>
  
  <p>Thanks!!!</p>