Sometimes, we want to fix SyntaxError: missing ) after argument list with JavaScript.
In this article, we’ll look at how to fix SyntaxError: missing ) after argument list with JavaScript.
How to fix SyntaxError: missing ) after argument list with JavaScript?
To fix SyntaxError: missing ) after argument list with JavaScript, we should make sure the open and closing parentheses match.
For instance, we write
const navs = document.getElementsByClassName("nav-coll");
for (const nav of navs) {
nav.addEventListener(
"click",
() => {
console.log("clicked");
},
false
);
}
to call getEleemntsByClassName
, addEventListener
and cnsole.log
with matching opening and closing parentheses to clear the error.
Conclusion
To fix SyntaxError: missing ) after argument list with JavaScript, we should make sure the open and closing parentheses match.