bool method_exists(object object, string method_name);
npm install method_exists --save
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;