Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get function parameters count javascript

function foo(a, b) {
    for (var i=0;i<arguments.length;i++) {
        console.log(arguments[i]);
    }
}

console.log(foo.length); // reports 2, even though `foo` can access all your arguments!
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #function #parameters #count #javascript
ADD COMMENT
Topic
Name
9+2 =