Created
September 24, 2011 14:16
-
-
Save hkulekci/1239367 to your computer and use it in GitHub Desktop.
magic_function in javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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