FrontendDeveloper.in

JavaScript question detail

When do you get a syntax error

A SyntaxError is thrown if you try to evaluate code with a syntax error. For example, the below missing quote for the function parameter throws a syntax error

try {
eval("greeting('welcome)"); // Missing ' will produce an error
} catch (err) {
console.log(err.name);
}
Back to all JavaScript questions
Get LinkedIn Premium at Rs 399