0

Having trouble getting every other month not be vacation

var month = parseInt(readLine(), 10) //your code goes here var august = "August" if (month == august){ console.log("vacation") }

13th Sep 2021, 4:06 AM
Noblex
Noblex - avatar
4 Respuestas
+ 8
var month = readLine()
13th Sep 2021, 4:10 AM
Simba
Simba - avatar
+ 6
parseInt converts your input to an integer. It gives an error if input doesn't include integers. That's why you need to use readLine() to take a string input.
13th Sep 2021, 4:13 AM
Simba
Simba - avatar
+ 2
Oh, that makes so much sense now. Thank you :)
13th Sep 2021, 4:14 AM
Noblex
Noblex - avatar
0
So why do I need to remove the parseint?
13th Sep 2021, 4:11 AM
Noblex
Noblex - avatar