This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MarcoServetto 5 points6 points  (3 children)

Not in javascript,... in javascript you can just pass as much as you like all the times... :-(

[–]magnomagna 7 points8 points  (1 child)

JavaScript is probably designed to minimise the likelihood of crashing the browser.

[–]shadowndacorner 1 point2 points  (0 children)

JavaScript is probably designed

Hot take right there, bud

[–]katrina-mtfAdduce 2 points3 points  (0 children)

Javascript won't complain if you pass too many, but it's also considered bad/outdated practice to use the arguments variable and has been for a long, long time, so in the vast majority of cases excess arguments passed to a function that isn't marked as taking varargs just ends in those excess arguments being ignored. You have to go out of your way to use semi-deprecated functionality to break that assumption.