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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -