JavaScript quietRules challenge | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

JavaScript quietRules challenge

function main() { var dayofWeek = readLine(); var quietRules = 'mowing, hanging out laundry, washing a car, recycling bottles are not allowed'; if (dayofWeek) { console.log('mowing, hanging out laundry, washing a car, recycling bottles are not allowed'); } //I keep getting it wrong because Iā€™m not suppose to output anything if the day of week isnā€™t Sunday! Help please!

19th Oct 2020, 11:08 PM
Tyrone Session
Tyrone Session - avatar
2 Respostas
+ 2
What is if(dayofWeek) suppose to do? Is it checking that if the user input (dayofWeek)!="Sunday" or what? anyway that's something basic you should know about before even getting started with a language like node , By the way read on how to take input in node https://nodejs.org/api/readline.html
20th Oct 2020, 12:01 AM
Abhay
Abhay - avatar
0
i got it thanks! function main() { var dayofWeek = readLine(); var quietRules = 'mowing, hanging out laundry, washing a car, recycling bottles are not allowed'; if (dayofWeek == 'Sunday') { console.log('mowing, hanging out laundry, washing a car, recycling bottles are not allowed'); }
20th Oct 2020, 12:16 AM
Tyrone Session
Tyrone Session - avatar