0

Help me with my task

process.stdin.setEncoding('utf-8'); let inputString = ''; process.stdin.on('data', inputStdin => { inputString += inputStdin; }); process.stdin.on('end', _ => { main(inputString); }); function main(input) { var dayofWeek = input; var quietRules = «I translated, but there is just my language phrase» if (dayofWeek = "Sunday") { console.log(«I translated, but there is just my language phrase») } Task : in One county there is “queut rule”, and some actions are are not allowed at the day when it rule works (in this case Sunday) This actions is (queitRules) So task, if it is Sunday = console have to write me rules, but if it is another day console have to be clean. I wrote this code, BUT LOLLLL, at Tuseday console writes me rules, but at only Sunday its clear. WTF HELP ME AAAAAAAAAAASAAS

10th Oct 2020, 8:01 AM
Alex Lovser
Alex Lovser - avatar
4 Answers
+ 2
If dayofWeek=="Sunday"
10th Oct 2020, 8:05 AM
Abhay
Abhay - avatar
+ 1
Works fine for me process.stdin.setEncoding('utf-8'); let inputString = ''; process.stdin.on('data', inputStdin => { inputString += inputStdin; }); process.stdin.on('end',()=> { main(inputString); }); function main(input) { var dayofWeek = input; console.log(dayofWeek) var quietRules = "I translated, but there is just my language phrase" if (dayofWeek == "Sunday") { console.log("I translated, but there is just my language phrase") } }
10th Oct 2020, 8:14 AM
Abhay
Abhay - avatar
+ 1
= is assignment operator the comparison operator is ==
10th Oct 2020, 8:24 AM
Gordon
Gordon - avatar
0
doesnt work
10th Oct 2020, 8:08 AM
Alex Lovser
Alex Lovser - avatar