0.0.3 • Published 8 years ago
method-exists v0.0.3
method exists
bool method_exists(object object, string method_name);
Installation
npm install method_exists --save
Basic Usage
const method_exists = require('method-exists');
class TestClass {
testMethod () {
console.log('This is testMethod');
}
}
var result = method_exists(new TestClass, 'testMethod');
console.log(result); // true;
var result = method_exists(new TestClass, 'noExistMethod');
console.log(result); // false;