What is the difference between rest parameters and the arguments object in JavaScript?
Rest parameters (...args) collect remaining arguments into a true array with methods like map and filter. arguments is array-like (has length and indices) but lacks array methods, and is not available in arrow functions.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Function Parameters vs Arguments in JavaScript
Parameters are the variable names listed in the function definition. Arguments are the actual values passed to the function when it is called.
If the caller passes undefined or omits the argument, the default value is used. Other falsy values like 0, null, or empty string do not trigger the default.
By reference (the reference is passed by value). Mutating the object inside the function affects the outer object. Reassigning the parameter does not affect the outer variable.
Still have questions?
Browse all our FAQs or reach out to our support team
