By mswatcher
via weblogs.asp.net
Published: Nov 16 2007 / 12:58
John Resig of Mozilla and jQuery fame has a very interesting post about method overloading in JavsScript. In a nutshell, he proposes a utility function that gives a relatively simple way of overloading a method. The different versions are distinguished by the number of arguments (not their types). Another way of seeing it is that he factors out into a single place code that would usually be at the start of the method. Go check it out, it's a really interesting use of closures. I'll wait until you're done.
Add your comment
Voters For This Link (15)
-
mswatcher -
bloid -
jkso -
palsforpals -
alexjc -
zoopzoopzoop -
rick -
jimbojw -
hrum -
mfoster -
shanefox -
gst -
eric_suen -
fabiocaseri -
ymax