0

I'm not sure what's wrong, any help? (I'm a beginner, bear with me here)

I'm trying to figure out the problem document.write("Calculator!") setTimeout(function(){ var userNum = prompt("What is your first number?") }, 1000); setTimeout(function(){ var userOp = prompt("What would you like your operation to be? + - * /") }, 1001); setTimeout(function(){ var userNum2 = prompt("Pick your second number") }, 1002); if (userOp === +){ var addNum = userNum + userNum2 document.write("Your answer is" + addNum); } else{ }

12th Nov 2016, 7:17 PM
Ebonee Davis
Ebonee Davis - avatar
4 Answers
+ 3
It's probably because you try to add two numbers and then pront them, where they should be a string.
12th Nov 2016, 7:45 PM
Keto Z
Keto Z - avatar
+ 2
What is your issue?
12th Nov 2016, 7:39 PM
Keto Z
Keto Z - avatar
0
it says "unexpected token ) on line 11"
12th Nov 2016, 7:42 PM
Ebonee Davis
Ebonee Davis - avatar
0
I didn't finish the If/else statement yet
12th Nov 2016, 7:42 PM
Ebonee Davis
Ebonee Davis - avatar