Link Details

Link 53270 thumbnail
User 225256 avatar

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.
  • 15
  • 0
  • 1019
  • 159

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (15)



Voters Against This Link (0)