0
What is the syntax error?
I have no idea what I’ve done wrong but my scripts show a “syntax error”. https://code.sololearn.com/WK4kZG0WwWlW/?ref=app
5 Antworten
+ 3
First of all your program doesn't print or show any output. Also I can't see you running calculate function anywhere.
Here I fixed a problem for you:
https://code.sololearn.com/WxxcT4qK1m53/?ref=app
But according to the errors you had in your code you should go all over the js course again.
+ 2
Go through lesson on if else again.
+ 2
Your if block missing parenthesis ().
Correct it.
In code , for example:
calories = (10 x weightKg) + (6.25 x heightCm) - (5 * age) - 1 61;
And you are 'x' symbol for multiplication but its not multiplication symbol in coding. Use * symbol for multiplication.
And ' - ' symbol also saying invalid. Correct it.
And what is 1 61 there? It may be 1.61
So correct way :
calories = (10 * weightKg) + (6.25 * heightCm) - (5 * age) - 1.61;
Function definition missing () also. Read function syntax again once to know more..
call the function to use it. otherwise no use of it.
0
I changed the if else statements to switch statements and defined empty variables before calling them. Still syntax error
0
Google it