+ 2
Javascript if statement
var month = parseInt(readLine(), 10) if(month == "August") { console.log("vacation") } Where I am wrong here?
9 Respostas
- 1
Hi !
I need your help, plleeeeaase
I'm stuck on this code coach since two weeks.
I tried a lot of things.
This is my last code :
var month = (readLine(), 10)
//your code goes here
if (month == "August") {
console.log("vacation");
}
+ 4
Emi_ICKART
just write
var month = readLine();
+ 3
Thanks so much. It's working now A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟
+ 3
It works!
Thank you so much !
I had tried this but certainly modified something else at the same time ...
+ 2
I dont think parseInt() will return a string.
+ 2
Rabiya Tayyab
There is a problem to taking input. Don't parse with Int.
That would be called as SL bug or intensely they have this.
+ 1
readLine is not defined
+ 1
Yes you are right. That's where I was doing a mistake. Thanks so much
+ 1
Arturop
yes parseInt returns integer value not String. readLine () bydefault accept everything as a String so to get integer you have parse the input with parseInt but in this practice input is String so no need to parse.