Sure, just use the arguments
object.
function foo() {
for (var i = 0; i < arguments.length; i++) {
console.log(arguments[i]);
}
}
More Related Contents:
- How to receive and maintain values in functions (javascript)
- Set a default parameter value for a JavaScript function
- Is there a better way to do optional function parameters in JavaScript? [duplicate]
- ES6 destructuring function parameter – naming root object
- jQuery pass more parameters into callback
- Is it possible to get all arguments of a function as single object inside that function?
- What happens if I call a JS method with more parameters than it is defined to accept?
- Multiple arguments vs. options object
- What happens if I call a function with more arguments than it is defined to accept?
- Passing a function with arguments as an argument?
- Pass only the second argument in javascript
- Javascript function not working, what is wrong? [closed]
- How would I make a Timer which times things in 0.75 seconds Javascript?
- How to use variable instead of function name in JavaScript
- Pass a JavaScript function as parameter
- Returning Chrome storage API value without function
- Can you bind ‘this’ in an arrow function?
- JavaScript check if variable exists (is defined/initialized)
- How to extend Function with ES6 classes?
- Advanced JavaScript: Why is this function wrapped in parentheses? [duplicate]
- JavaScript ES6: Test for arrow function, built-in function, regular function?
- Call function with array of arguments
- How do I store javascript functions in a queue for them to be executed eventually [duplicate]
- Converting an array to a function arguments list [duplicate]
- javascript – document.write error?
- What happens when JavaScript variable name and function name is the same?
- js function to get filename from url
- List of global user defined functions in JavaScript?
- jQuery asynchronous function call, no AJAX request
- What is the difference between onClick=”javascript: function(‘value’)'” and onClick=”function(‘value’);”? [duplicate]