-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditional.js
75 lines (56 loc) · 1.35 KB
/
conditional.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
var isFoodReady = true;
var isWaterReady = false;
// jodi food ready hoy taile ami khamu
// if food is ready, I will eat.
// if food is ready == true
/*
if (condition) {
}
*/
if (isFoodReady == true) {
console.log('Mama!! I will eat now.');
}
if (isWaterReady == false) {
console.log('Mama make water ready Otherwise!! I will not eat now.');
}
if (isWaterReady == true) {
console.log('Mama!! I will not eat now.');
}
var iphonePrice = 70000;
var myBudget = 9500;
if (iphonePrice < myBudget) {
console.log('I am not able to purchase the iPhone!');
}
var iphonePrice1 = 70000;
var myBudget1 = 120000;
if (iphonePrice1 < myBudget1) {
console.log('Now, I am able to purchase the iPhone!');
}
var iphonePrice = 70000;
var myBudget = 9500;
if (iphonePrice > myBudget) {
console.log('My Samsung phone is the best!');
}
// condition with if else
/* if (condition) {
//output code goes here
}
else {
//output code goes here
} */
var chickenPrice = 180;
var myMoney = 50;
if (chickenPrice < myMoney) {
console.log('Yes!! Murgir run khamu ar haddi chibamu');
}
else {
console.log(' oh no!! smashed potato with lentil soup!');
}
var chickenPrice = 180;
var myMoney = 850;
if (chickenPrice < myMoney) {
console.log('Yes!! Murgir run khamu ar haddi chibamu');
}
else {
console.log(' oh no!! smashed potato with lentil soup!');
}