-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_Op_Data_Condi_Loop.js
90 lines (72 loc) · 1.27 KB
/
_Op_Data_Condi_Loop.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// OPERATOR'S
let a=10;
let b=20;
console.log(a+b)
console.log(a-b)
console.log(a*b)
console.log(a/b)
console.log(a**b)
console.log(a+b)
console.log(a+b)
console.log(a-b)
console.log(a%b)
//DATA TYPES
a=10
b=2.32
c="NSLONI"
d=true
e='s'
console.log(typeof(a)) //number
console.log(typeof(b)) //number
console.log(typeof(c))
console.log(typeof(d)) //boolean
console.log(typeof(e)) //string
// CONDITIONAL--->if, else
a=12; //Even
if(a%2==0){
console.log("Even")
}
else{
console.log("Odd")
}
// RATING
rating=2;
if(rating==1){
console.log(" one point")
}
else if(rating==2){
console.log("Rating 2")
}
else if(rating==3){
console.log("Rating 3")
}
else if(rating==4){
console.log("Rating 4")
}
else console.log("Exellent")
// a=5
// s='5'
// console.log(a==s) //true
// console.log(a===s) //false
// LOOPING
// for
for(let i=0; i<=10; i++){
console.log(i) // output : 1 to 10
}
// while
let i=1
while (i<=10){
console.log(i) // output : 1 to 10
i++
}
i=1
do{
console.log(i) // output : 1 to 10
i++
}while(i<=10)
// PATTERN
for(let i=0; i<=5; i++){
for(let j=1; j<=i; j++){
console.log("*")
}
}