title: Can a Javascript Array or Object be overridden to be callable?
body: <p>I want to figure out if Array[] and Object[] can be replaced by Array() and Object(). Can a function prototype be stuck into arrays or objects prototype chain to make them callable. Basically I am looking for some thing like this:</p>
  
  <pre><code>// some magic with prototypes
  ????????????????
  
  a = [1, 3, 4]
  b = [1, 3, 4]
  
  console.log(a[1]) // prints 3
  console.log(b(1)) // prints 3
  
  a[0] = -1
  // same as
  b(0, -1)
  
  console.log(a[1], b(1)) // prints -1 -1
  </code></pre>
  
  <p>Thanks alot!</p>