Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at NCDevCon 2011 (Raleigh, NC) with:

EtchEmKay

Member since Sep 10, 2010

Recent Blog Comments By EtchEmKay

  • Overloading Javascript Functions Using A Sub-Function Approach

    Posted on Sep 10, 2010 at 6:23 AM

    A (very) quick prototype of a cleaner way of doing (strict) arguments check for both - type and count - Function.prototype.overload = function () { this.variants = this.variants || {}; var len = arguments.length, args = (Array.prototype.slice.call(arguments)), id = args.slice(0,le... read more »

  • Overloading Javascript Functions Using A Sub-Function Approach

    Posted on Sep 10, 2010 at 1:51 AM

    Oops .. the comment in the last line of code above should read "calls the 2-param version" .. which I think is a better implementation considering that the randRange() function essentially wants to deal with maximum of 2 arguments .. any more should be ignored.... read more »

  • Overloading Javascript Functions Using A Sub-Function Approach

    Posted on Sep 10, 2010 at 1:43 AM

    Another way of doing it (shorter version) - function randRange(){ (randRange[arguments.length] || randRange[2]).apply(this, arguments); } randRange[0] = function () { alert('Error: No parameters passed!'); return 0; }; randRange[1] = function (max) { return( randRange[2]( 0, max ) )... read more »