Syntax error:Missing") " after the argument list. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Syntax error:Missing") " after the argument list.

For some reason, no matter what i do, i can never use the addEventListener function, cuz i always get the same error. As far as i know all the () s and {} match each other, i have been thinking about it for 3 hours and cant figure out what's wrong :D it's driving me crazy :D the error is on line 3. https://code.sololearn.com/Wv7VZEXJUJ3C/?ref=app

20th May 2019, 9:53 PM
armin harper
6 Answers
+ 7
Welcome armin harper . Correct lines 6 & 7. grade --- 6. grades --- 7
20th May 2019, 11:18 PM
Jella
Jella - avatar
+ 6
~ swim ~ notice g in the initial code? It's not defined. Note: I'm not solving the whole problem. I'm letting him think a little. It helps him understand better rather than doing the whole thing and he learns nothing. He has to learn from his mistakes.
20th May 2019, 11:14 PM
Jella
Jella - avatar
+ 4
I figured out some of the errors. Here's the code but it isn't completely debugged. You have to figure out the rest. It's the least I could do. https://code.sololearn.com/WPT3z8q4Ax7V/?ref=app
20th May 2019, 10:41 PM
Jella
Jella - avatar
+ 3
armin harper there are a lot of errors in this code. First:-> There's a missing ) to complete the parenthesis in lines 3 after f(). f is not defined. grades is not defined in lines 9. There's no ; after the f ()); <--- Continue......
20th May 2019, 10:20 PM
Jella
Jella - avatar
+ 1
Thank you for ur help and for letring me figure this out by myself :) i thought i was using g() as an Anonymous function which only exists inside the loop :)
20th May 2019, 11:17 PM
armin harper
0
Hmm so this is how i think: . the correct format for an eventListener is var. addEventListener("event", f() {}) right? Well since the {} section was too long i have added tge)} at the end. also how come grades is not defined? I have stated that grades=prompt earlier in the code? i may be wrong tho, im a n00b :D
20th May 2019, 10:25 PM
armin harper