Hidden Features of JavaScript? -


what "hidden features" of javascript think every programmer should know?

after having seen excellent quality of answers following questions thought time ask javascript.

even though javascript arguably important client side language right (just ask google) it's surprising how little web developers appreciate how powerful is.

you don't need define parameters function. can use function's arguments array-like object.

function sum() {     var retval = 0;     (var = 0, len = arguments.length; < len; ++i) {         retval += arguments[i];     }     return retval; }  sum(1, 2, 3) // returns 6 

Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -