Home
Blog
Twitter
About
Friday, May 06, 2011
TIL: In JavaScript function.length returns the number of arguments it supports
function test(a, b, c)
{
}
alert(test.length);
In this piece of code if you use
.length
on a function it returns the number of named arguments that this function accepts.
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)