title: JavaScript: Can I use square brackets ([]) operator as a function?
body: <p>Is it possible for any arbitrary object to obtain a reference to an accessor function that would act exactly as <code>[]</code> operator?</p>
  
  <p>Something like the following?:</p>
  
  <pre><code>function get(x) { return this[x] }
  </code></pre>
  
  <p>So that if I had an object <em>foo</em> instead of doing <code>foo['bar']</code> I could call <code>foo.get('bar')</code></p>