Hello, I am trying to figure out a way to get a default function that is called if a function does not exist. For example
var foo = {
bar: function(){
console.log("Bar was called")
},
unknown: function(){
console.log("Unknown was called")
}
}
foo.bar(); // Should log "Bar was called"
foo.biz(); // Should log "Unknown was called"
Is there any way to do this cross browser, and if not then is there a way to do this in certain browsers? Thank you