Is there a method or propertie to get all methods from an object? For example:
function foo() {} foo.prototype.a = function() {} foo.prototype.b = function()
In ES6:
let myObj = {myFn : function() {}, tamato: true}; let allKeys = Object.keys(myObj); let fnKeys = allKeys.filter(key => typeof myObj[key] == 'function'); console.log(fnKeys); // output: ["myFn"]