Is there a way how to create a default method call when the method that is called from object is undefined?
e.g.
myObj = {
default: function(){
console.log("You've called method that isn't defined");
},
sayHi: function(){
console.log("myObj says Hi!");
}
}
//console output: "myObj says Hi!"
myObj.sayHi();
//console output: "You've called method that isn't defined"
myObj.methodThatIsNotReallyThere();