FrontendDeveloper.in

JavaScript question detail

What are the differences between arguments object and rest parameter

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
Back to all JavaScript questions
Get LinkedIn Premium at Rs 399