title: Accessing javascript instance member when passing the method
body: <p>I wrote some code like this</p>
  
  <pre><code>function Flasher() {
      this.cards = []
      this.map = {
          14: this.flip
      }
  }
  Flasher.prototype.flip = function() {
      alert(this.cards.length)
  }
  flasher = new Flasher()
  flasher.map[14]()
  </code></pre>
  
  <p>Unfortunatley, the <code>this</code> object becomes the map object within the <code>flip</code> method and an error occurs (because <code>cards</code> is undefined).</p>
  
  <p>How can I get this to function as intended? Calling <code>flip</code> indirectly via <code>map</code> is necessary, but I would like access to the original object within <code>flip</code>.</p>