Skip to content

Commit d4efcd3

Browse files
Create condition.js
1 parent 0baf9df commit d4efcd3

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

study/condition.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
let answer = "Picasso";
2+
if (answer === "Picasso") {
3+
console.log(answer + " is correct!");
4+
}
5+
let answer1 = "Matisse";
6+
if (answer1 !== "Picasso") {
7+
console.log(answer1 + " is wrong!");
8+
}
9+
let age = 75;
10+
if (age >= 55) {
11+
console.log("Discount applied");
12+
}
13+
let isDay = true;
14+
if (isDay === true) {
15+
console.log("Lights off!");
16+
}
17+
let score = 51;
18+
let pass = score > 50;
19+
if (pass) {
20+
console.log(pass);
21+
}
22+
const song = "Don't stop me now";
23+
let replayTimes = 345;
24+
if (
25+
replayTimes >= 300) {
26+
console.log("Your top song this week: ");
27+
console.log(song);
28+
}
29+
const diet = "vegetarian";
30+
const veggieRestaurant = "Root";
31+
const restaurant = "DelPosto";
32+
if (diet === "vegetarian") {
33+
console.log("Try out: ");
34+
console.log(veggieRestaurant);
35+
}
36+
let today = "Sunday";
37+
if (today !== "Saturday") {
38+
console.log("Set alarm at 8:00");
39+
}
40+
let age1 = 20;
41+
let canDrive = false;
42+
if (age1 > 18) {
43+
canDrive = true;
44+
}
45+
console.log(canDrive);
46+
let inboxFull = true;
47+
const showAlert = inboxFull === true;
48+
if (showAlert) {
49+
console.log("Your inbox is full.");
50+
console.log("You can't receive any more emails");
51+
}
52+
let flightModeOn = true;
53+
if(flightModeOn === true) {
54+
console.log("Turn flight mode off to connect to the internet");
55+
}

0 commit comments

Comments
 (0)