Aryan PrajapatKnowledge Contributor
What are the differences between arguments object and rest parameter
What are the differences between arguments object and rest parameter
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
There are three main differences between arguments object and rest parameters
The arguments object is an array-like but not an array. Whereas the rest parameters are array instances.
The arguments object does not support methods such as sort, map, forEach, or pop. Whereas these methods can be used in rest parameters.
The rest parameters are only the ones that haven’t been given a separate name, while the arguments object contains all arguments passed to the function