+ 1

I dare you to give me the output without displaying the code in the play ground !!!

var num1 = prompt("What's your level?");// let's assume that you entered 1 var num2 = num1 + 1; document.write(num2);//what will you get ?

24th Apr 2017, 11:51 AM
Abdel
Abdel - avatar
9 Antworten
+ 4
I hope so that prompt always takes string input. So output must be "1"+1=11.
31st May 2017, 3:33 PM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 3
OMG!!! Why you told the answer!?
24th Apr 2017, 12:51 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 2
No @Donald , whatever you put in a prompt input , it will treat it like a sting so the 1 you putted will be a string and the other 1 will be added next to it result >>> 11
24th Apr 2017, 12:07 PM
Abdel
Abdel - avatar
+ 1
@Donald cat , try to add 1 in the prompt input and give the result
24th Apr 2017, 11:52 AM
Abdel
Abdel - avatar
+ 1
is it 11? I didnt try but input should be a string
24th Apr 2017, 11:53 AM
h8c
h8c - avatar
+ 1
@Baris you're a javascript beast you'll gain my following
24th Apr 2017, 12:00 PM
Abdel
Abdel - avatar
+ 1
bcz @Baris had told it
24th Apr 2017, 2:03 PM
Abdel
Abdel - avatar