-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathifelse.js
50 lines (44 loc) · 1.04 KB
/
ifelse.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// todo if statment in js
var a = prompt("Enter The Value");
var b = 67;
if (a === b) {
alert("Correct");
}
if (a !== b) {
alert("Wrong");
}
// todo comparison operators
if (a < b) {
alert("It's Less Than b");
}
if (a > b) {
alert("It's Greater Than b");
}
if (a <= b) {
alert("It's is less than or equal to b");
}
if (a >= b) {
alert("It's is gr'eater than or equal to b");
}
// todo if...else and else if statements
var mybrothername = prompt("Write My Brother Name");
if (mybrothername === "Shahzain") {
alert("Thats Correct");
} // todo else if is leye use hota he kue ke agar if
// todo ke statement true he to else if chale ga phir
// todo else chalega
else if (mybrothername === "Kashan") {
alert("Incorrect But Close !");
}
// todo iagar else if flase he to ye else if ko chalae ga leken
// todo agar ye true ho gya to else cale ga
else {
alert("Wrong");
}
// todo testing sets of condition
if (weight === mynumber && minus === plus) {
alert("Correct");
}
if (weight !== mynumber || minus !== plus) {
alert("Incorrect");
}