InterviewHubPRO
Section Overview
Q191

Question 191 of 521

Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

37%
JavaScript Internals (521 Qs)•Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

What happens if you do not use rest parameter as a last argument

The rest parameter should be the last argument, as its job is to collect all the remaining arguments into an array. For example, if you define a function like below it doesn’t make any sense and will throw an error.

javascript
  function someFunc(a,…b,c){
  //You code goes here
  return;
  }