title: How to check if anonymous object has a method?
body: <p>How can I check if an anonymous object that was created as such:</p>
  
  <pre><code>var myObj = { 
      prop1: 'no',
      prop2: function () { return false; }
  }
  </code></pre>
  
  <p>does indeed have a prop2 defined?</p>
  
  <p><code>prop2</code> will always be defined as a function, but for some objects it is not required and will not be defined.</p>
  
  <p>I tried what was suggested here: <a href="https://stackoverflow.com/questions/595766/how-to-determine-if-native-javascript-object-has-a-property-method">How to determine if Native JavaScript Object has a Property/Method?</a> but I don't think it works for anonymous objects .</p>