Skip to content

Instantly share code, notes, and snippets.

@hkulekci
Created September 24, 2011 14:16
Show Gist options
  • Select an option

  • Save hkulekci/1239367 to your computer and use it in GitHub Desktop.

Select an option

Save hkulekci/1239367 to your computer and use it in GitHub Desktop.
magic_function in javascript
var foo = {
__noSuchMethod__ : function(id, args) {
console.log("id: "+id);
console.log("Arg: "+args);
},
bar:function(a,b){
console.log("OK!");
}
};
foo.bara(1, 2,3,4,5);
foo.bar(0, 3);
// Non-standard (firefox only)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment