Help with Web Dev Code Repo Project: Event Handling | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help with Web Dev Code Repo Project: Event Handling

I am getting the following error when I try to run the code: uncaught SyntaxError: Unexpected identifier Line 16Please help https://code.sololearn.com/WLgLFPJ69wQC/?ref=app

17th May 2022, 7:02 AM
Stacey Prahl
Stacey Prahl - avatar
5 Answers
0
You forgot the parentheses around the condition in your if statement. Same in line 21.
17th May 2022, 7:29 AM
Simon Sauter
Simon Sauter - avatar
0
I fixed that error but now I have a new issue: Uncaught SyntaxError: unexpected identifier Line 34
17th May 2022, 8:10 AM
Stacey Prahl
Stacey Prahl - avatar
0
JS in Link above has been updated
17th May 2022, 8:13 AM
Stacey Prahl
Stacey Prahl - avatar
0
There is an underscore ("_") at the end of the line.
17th May 2022, 8:23 AM
Simon Sauter
Simon Sauter - avatar
0
There are some issues with the logic in your code. My first question is: what are you trying to do (maybe because I am not pro, I do not have access to this project and so have no info on it)? On line 10, You used let price = calc(adult, children) The variable adult is not defined in your script, unless you meant to use adults Also on line 10 calc is not a built in function in JS, hence it is not defined so you must define it. I think calc is only built-in for CSS. A few other syntax errors are in the if statements (line 16 and 21) you used assignment (=) when it should be equals to (==) or strict equals to (===) a and a.value is not defined nor is c and c.value
17th May 2022, 12:03 PM
Amaani
Amaani - avatar