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.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment