+ 1

If statement

Cons time = 0700; Let wakeUp; Write an “if” statement that checks if “time” is equal to “0730”, if time is equal to 0730 assign the variable “wakeUp” the value of “true”, else, assign wakeUp false.

7th Feb 2018, 6:27 PM
Luis
Luis - avatar
5 Antworten
+ 1
are you asking for this 👇 var wake =prompt("Enter time"); if(wake === "0730"){ alert("true") }else{ alert("false") }
7th Feb 2018, 7:00 PM
Sudarshan Rai
Sudarshan Rai - avatar
+ 2
Yea i just figured it out too! Thanks
7th Feb 2018, 7:01 PM
Luis
Luis - avatar
+ 2
Well mine looks like this: Coms time = 0700; let wakeUp; If(time === 0730) { wakeUp = true; } else{ wakeUp=false;}
7th Feb 2018, 7:05 PM
Luis
Luis - avatar
+ 1
you have error on your code you haven't declared time o730 should be between " here" and many error
7th Feb 2018, 7:16 PM
Sudarshan Rai
Sudarshan Rai - avatar
0
ok @luis good night 😁
7th Feb 2018, 7:03 PM
Sudarshan Rai
Sudarshan Rai - avatar