Advertisement
728x90
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
1function someFunc(a,…b,c){
2 //You code goes here
3
4return;
5}Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 16
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
187of476