Skip to content
Related Articles

Related Articles

JavaScript SyntaxError – Missing ) after argument list
  • Last Updated : 24 Jul, 2020

This JavaScript exception missing ) after argument list occurs if there is an error in function calls. This could be a typing mistake, a missing operator, or an unescaped string.

Message:

SyntaxError: Expected ')' (Edge)
SyntaxError: missing ) after argument list (Firefox)

Error Type:

SyntaxError

Cause of Error: Somewhere in the code, there is an error with function calls. This could be either be a typing mistake, a missing operator, or an unescaped string.

Example 1: In this example, there is a missing operator in string concatenation, So the error has occurred.



HTML




<!DOCTYPE html>
<html>
<head>
    <title>Syntax Error</title>
</head>
<body>
    <script>
        var str1 = 'This is ';
        var str2 = 'GeeksforGeeks';
        document.write(str1 str2);
    </script>
</body>
</html>

Output(In console):

SyntaxError: missing ) after argument list

Example 2: In this example, there is a unescaped string, So the error has occurred.

HTML




<!DOCTYPE html>
<html>
<head>
    <title>Syntax Error</title>
</head>
<body>
    <script>
        var str1 = 'This is ';
        var str2 = 'GeeksforGeeks';
        document.write(str1 \str2);
    </script>
</body>
</html>

Output(in console):

SyntaxError: missing ) after argument list
My Personal Notes arrow_drop_up
Recommended Articles
Page :