What does the rest parameter (…args) do in a function definition?

JavaScript Associate Easy

JavaScript Associate — Easy

What does the rest parameter (…args) do in a function definition?

Key points

  • Enables variable argument count handling
  • Creates an actual array from remaining arguments
  • Doesn't spread or copy existing arrays
  • Supports flexible function invocation

Ready to go further?

Related questions