I came across the following question about StackOverflow: How many parameters are too many?
This made me wonder if there is a practical limit to the number of parameters of the JS function?
It turns out that JavaScript imposes a practical limit of 65,536 parameters on functions.
However, what is interesting is that the error message says that the limit is 65535 parameters:
SyntaxError: Too many parameters in function definition (only 65535 allowed)
So, I have two questions:
- Why is this a mismatch? Is this a mistake one at a time in language implementations?
- Does the ECMAScript standard provide this limit for function parameters?
source share