简体   繁体   中英

SyntaxError: invalid arrow-function arguments (parentheses around the arrow-function may help),javascript begginer

I have this error and i dont know what to do enter image description here

and this is the code

enter image description here

Change this:

navLinks.forEach(link, index) => {
   //code
}

To this:

navLinks.forEach((link, index) => {
   //code
})

When there are two parameter and you are using the arrow, you should enclose the parameter in the parenthesis ( ). See your forEach method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM