Having trouble with a code... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Having trouble with a code...

I'm trying to improve on a code I have, but the console says that a block of code I made has a missing parenthesis, though that "missing )" is clearly not missing. Any suggestions?

5th Nov 2017, 11:22 PM
The A.I. Future Guy
The A.I. Future Guy - avatar
6 Answers
+ 1
var x = (13*14) // missing semicolon var y = (15/5) // missing semicolon if(x>=y) { document.write(x+y) // missing semicolon } else(x>y) // else doesn't take a condition { alert("How many idiots does it take to get through a bush?"); }{ // What is this block for? document.write( 1 to figure it out the other 184 to try to run through it!); // The sentence between () needs to be in quotes. }
5th Nov 2017, 11:34 PM
ChaoticDawg
ChaoticDawg - avatar
+ 3
maybe post your code?
5th Nov 2017, 11:26 PM
Jeremy
Jeremy - avatar
0
The curly braces aren't needed, unless you intended to have an if-else if -else statement instead of an if-else with the document.write() always running after.
5th Nov 2017, 11:38 PM
ChaoticDawg
ChaoticDawg - avatar
- 1
Sure!
5th Nov 2017, 11:27 PM
The A.I. Future Guy
The A.I. Future Guy - avatar
- 1
It's the commentary and alert sample
5th Nov 2017, 11:31 PM
The A.I. Future Guy
The A.I. Future Guy - avatar
- 1
That was part of a little joke, and thnx!
5th Nov 2017, 11:35 PM
The A.I. Future Guy
The A.I. Future Guy - avatar