canInvoke (obj, methodName) Booleanprivate
Checks to see if the methodName exists on the obj.
let foo = { bar: function() { return 'bar'; }, baz: null };
Ember.canInvoke(foo, 'bar'); // true
Ember.canInvoke(foo, 'baz'); // false
Ember.canInvoke(foo, 'bat'); // false
Parameters:
-
obj
Object - The object to check for the method
-
methodName
String - The method name to check for
Returns:
-
Boolean
Please login to continue.