SyntaxError: missing ) after argument list
Message
JavaScript
Copy Code
SyntaxError: missing ) after argument list
Error type
What went wrong?
There is an error with how a function is called. This might be a typo, a missing operator, or an unescaped string, for example.
Examples
Because there is no "+" operator to concatenate the string, JavaScript expects the argument for the log
function to be just "PI: "
. In that case, it should be terminated by a closing parenthesis.
JavaScript
Copy Code
console.log("PI: " Math.PI); // SyntaxError: missing ) after argument list
You can correct the log
call by adding the "+
" operator:
JavaScript
Copy Code
console.log("PI: " + Math.PI); // "PI: 3.141592653589793"
See also
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/javascript/reference/errors/missing_parenthesis_after_argument_list