Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

SyntaxError: missing ) after argument list

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

Message

SyntaxError: missing ) after argument list

Error type

SyntaxError.

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.

console.log("PI: " Math.PI);
// SyntaxError: missing ) after argument list

You can correct the log call by adding the "+" operator:

console.log("PI: " + Math.PI);
// "PI: 3.141592653589793"

See also

文档标签和贡献者

 此页面的贡献者: fscholz
 最后编辑者: fscholz,