Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What are the differences between arguments object and rest parameter in javascript?
Home
JavaScript
What are the differences between arguments object and rest parameter in javascript?
0
votes
asked
Oct 24, 2023
in
JavaScript
by
DavidAnderson
What are the differences between arguments object and rest parameter in javascript?
javascript-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Oct 24, 2023
by
DavidAnderson
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
...