Quick Answer
Fix unbalanced parentheses in functions.
Understanding the Issue
This syntax error occurs when parentheses are mismatched in function definitions or calls.
The Problem
This code demonstrates the issue:
Javascript
Error
function sum(a, b {
return a + b;
}
The Solution
Here's the corrected code:
Javascript
Fixed
// Corrected syntax:
function sum(a, b) {
return a + b;
}
// Proper function call:
console.log("Hello");
// Arrow functions:
const add = (a, b) => a + b;
Key Takeaways
Always balance parentheses in function definitions and calls.