+ 1
Javascript Practice Question 14.2
The if Statement You are planning a vacation in August. You are given a program that takes the month as input. Task Complete the code to output "vacation", if the given month is August. Don't output anything otherwise. Sample Input August Sample Output vacation var month = parseInt(readLine(), 10) if (month == "August") { console.log ("vacation") } Can anyone tell me what I'm doing wrong? Please.
3 Respuestas
0
Thanks a lot!
- 2
something is wrong with that challenge.
because if you output console.log(month)
you get NaN, parseInt is supposed to get a number not a string.
so the condition is never true for "August".