What is the difference between `arguments` object and rest parameters `…args`?

JavaScript Professional Medium

JavaScript Professional — Medium

What is the difference between `arguments` object and rest parameters `…args`?

Key points

  • `arguments` is array-like, while rest parameters create a real Array
  • `arguments` is available in regular functions, rest parameters work in arrow functions
  • `arguments` does not support array methods, rest parameters do
  • Rest parameters only include excess arguments, while `arguments` includes named params too

Ready to go further?

Related questions