title: Pass anonymous method belonging to object as an argument- Javascript
body: <p>I have an object with a method, I want to pass the method as an argument to another function. However the function must know the object associated with the method (or it can't access values assigned to the object after creation).</p>
  
  <p>Is there a way to this without resorting to passing the object/method as a string?<br>
  (ex not using: <code>window[function_name];</code>)</p>
  
  <pre><code>function My_Object(name){
      this.name = name;
  }
  
  My_Object.prototype.My_Method = function(){
       alert(this.name);
  }
  
  //This is the function that passes the method
  function Runner(){
       var NewObject = new My_Object('Andre');
       test(NewObject.My_Method);//this is where it should break
  }
  
  //This is the function that receives and calls the Object's method
  function test(func){
      func();
  }
  </code></pre>