Something is wrong!!! Please HELP!!! | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Something is wrong!!! Please HELP!!!

Complete the code to output "vacation", if the given month is August. Don't output anything otherwise. My code…. var month = parseInt(readLine(), 10) //console.log(month); if (month =="August") { console.log("vacation") }

10th Sep 2021, 7:06 PM
Edgar Ektibaryan
3 ответов
+ 3
Is it the code project from javascript course? The given code in the default is misleading. You need to remove the parseInt() – the task description shows that a string input is expected.
10th Sep 2021, 7:33 PM
Lisa
Lisa - avatar
+ 1
correct code is: var month = readLine() if(month == "August") { console.log("vacation") } else { console.log("") }
24th Nov 2021, 5:40 PM
DRH Code
DRH Code - avatar
0
Okay,but as you can see, at the bottom of the if i have comented the console.log(month), and when i run the program without comment, it shows NAN(i thought as you said, but after runing console.log(mounth), just for checking i got confused))).
10th Sep 2021, 7:16 PM
Edgar Ektibaryan