+ 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.

9th Sep 2021, 11:32 PM
Guillermo Segura
Guillermo Segura - avatar
3 Antworten
0
Thanks a lot!
10th Sep 2021, 12:03 AM
Guillermo Segura
Guillermo Segura - avatar
- 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".
10th Sep 2021, 12:02 AM
Bahhaⵣ
Bahhaⵣ - avatar