- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path14_conditional_statement.js
More file actions
Latest commit
57 lines (46 loc) · 1.07 KB
/
Copy path14_conditional_statement.js
File metadata and controls
57 lines (46 loc) · 1.07 KB
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
// > , < , >=, <=, ==, ===, !=, !===
// > >= bigger , bigger-than
// < <= smaller, smaller-than
// here basic if statement
if(true){
// will execute cz true
console.log('hello there');
}
if(false){
// not execute but false and not else here
console.log('hello there');
}
letmyName='dncode';
myName='something else';
// here is same with dncode and will execture first condition
if(myName=='dncode'){
console.log('Hello my name is dncode');
}else{
// but after reasign will execute here
console.log('Already changed be something else');
}
// example
letvalue=5>2;
value=5<2;
if(value){
console.log('true');
}else{
console.log('five is bigger than 2');
}
// example again
constnum1=10;
constnum2=10;
constresult=num1>=num2;
if(num1>num2){
console.log('num1 is bigger than num2');
}elseif(result){
console.log('num1 and num2 is equal');
}
// != is originall true will false,
// and if originally false will true
constname=false;
if(!name){
console.log('hellooo..');
}else{
console.log('not print cz !=');
}