Esta tradução está incompleta. Por favor, ajude a traduzir este artigo.

Messagem

SyntaxError: expected expression, got "x"
SyntaxError: expected property name, got "x" 
SyntaxError: expected target, got "x"
SyntaxError: expected rest argument name, got "x"
SyntaxError: expected closing parenthesis, got "x"
SyntaxError: expected '=>' after argument list, got "x"

Tipo de erro

SyntaxError

O que deu errado?

A specific language construct was expected, but something else was provided. This might be a simple typo.

Exemplos

Expression expected

For example, when calling functions, trailing commas are not allowed. JavaScript will expect another argument, which can in fact be any expression.

Math.max(2, 42,);
// SyntaxError: expected expression, got ')'

Correct would be omitting the comma or adding another argument:

Math.max(2, 42);
Math.max(2, 42, 13 + 37);

Veja também

Etiquetas do documento e colaboradores

 Colaboradores desta página: rubenfaria
 Última atualização por: rubenfaria,