+ 3
Quiet Rules problem (If statements)
Hello! Iām having a tough time getting the output āObey the rulesā for just Sunday out of all the days of the week in this code challenge. Any help is much appreciated!
15 Respostas
+ 4
Nick Carothers show your attempt
+ 3
if (day1 == day) {
console.log(rules) ;
}
day is the input
And also it will be == and not =
+ 3
+ 2
md saif Don't spam
+ 2
+ 2
Nick Carothers I was not saying to you. I said to md saif who was spamming in QA.
+ 2
Okay cool just wondering. Thank you!
+ 1
hmmm I tried that and it still didnt work
+ 1
Iām not spamming. Just trying to figure out a problem. Was that directed towards me or
someone else?
+ 1
Finally got it! Thanks for the help!
+ 1
Hi Darryl. Since the day variable equals all the days, and the rules variable equals āobey the rulesā, I created a Sunday variable which equals āSundayā. i then used an if statement to compare the Sunday variable to the day variable, then console.log(). I donāt want to give it away. Find out which comparison operator between Sunday and day, and what I put in the console.log() to solve the problem. Hopefully this helps some!
0
i could use some assistance on this one too
0
yes i figured it out and was easier than i thought
0
nice!
- 1
function main() {
var day = readLine();
var rules = 'Obey the rules';
// Your code goes here
var day1 = 'Sunday'
if (day1 = rules);
console.log(rules);
}