DEV Community

Discussion on: 5 Uses for the Spread Operator

Collapse
 
ajmath62 profile image
Aaron Klein

That may be the case in other languages, but not in JS. In JS, if you pass too many arguments, the extras will be ignored (but accessible through the variable named arguments). If you pass too few arguments, the missing arguments will be given the value undefined (which may result in an error, but not definitely).

Thread Thread
 
laurieontech profile image
Laurie

You're correct, I put my Java hat back on and shouldn't have!
Looks like this has some good explanations. stackoverflow.com/questions/126940...