I have a javascript object with some functions inside, I wish I could call them in a loop, something like this:
funcs: {
func1: function() {
return true;
},
func2: function() {
return false;
}
}
for(func in funcs) {
console.log(funcs[func]());
console.log(funcs[func].call());
}
var funcs = {...}). The second version will default the context to the global object unless an object instance is passed in as the first parameter:funcs[func].call(funcs)