0 votes
in JavaScript by
What are the differences between arguments object and rest parameter in javascript?

1 Answer

0 votes
by

There are three main differences between arguments object and rest parameters

  1. The arguments object is an array-like but not an array. Whereas the rest parameters are array instances.
  2. The arguments object does not support methods such as sort, map, forEach, or pop. Whereas these methods can be used in rest parameters.
  3. 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
...