-
Notifications
You must be signed in to change notification settings - Fork 12
/
day1code.log
169 lines (169 loc) · 1.93 KB
/
day1code.log
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
var x;
undefined
x = 10;
10
typeof x;
'number'
typeof undefined;
'undefined'
a=10.20;
10.2
typeof undefined;
'undefined'
typeof a;
'number'
a=1;
1
typeof a;
'number'
a=1111111111111;
1111111111111
typeof a;
'number'
a = 10 /0;
Infinity
typeof a;
'number'
a= 10- "ten";
NaN
a + 1000;
NaN
isNaN(a);
true
isNaN(a)?0:a;
0
a = 10/0;
Infinity
isFinite(a);
false
isFinite(a)?a:0;
0
a= "100";
'100'
a + 200;
'100200'
parseInt(a) + 200;
300
parseFloat("100.20") + 20;
120.2
a;
'100'
a + 100;
'100100'
parseInt(a) + 200;
300
a - 10;
90
a - "ten"
NaN
a * 10;
1000
a;
'100'
a**3;
1000000
a = 'Amit';
'Amit'
typeof a;
'string'
a = "Amit";
'Amit'
typeof a;
'string'
a=`gdfgkljdfglkf
ghdkj
ghdsjkf
fhgskdj`;
'gdfgkljdfglkf\nghdkj\nghdsjkf\nfhgskdj'
console.log(a);
VM986:1 gdfgkljdfglkf
ghdkj
ghdsjkf
fhgskdj
undefined
typeof console;
'object'
typeof console.log
'function'
var x = 10;
undefined
var y = 20;
undefined
`X is ${x} and y is ${y}`; // String Interpolation
'X is 10 and y is 20'
var att =true;
undefined
typeof att;
'boolean'
a = 'amit';
'amit'
a.toUpperCase();
'AMIT'
var age = 21;
undefined
typeof age;
'number'
var amit = {id:1001, name:};
VM1404:1 Uncaught SyntaxError: Unexpected token '}'
var amit = {id:1001, name:'Amit', address:'Delhi'};
undefined
typeof amit;
'object'
var temp = [10,20,30,40,11, 22,44,21,20];
undefined
temp[0];
10
temp[1];
20
var temp = {'delhi':43, 'mumbai':33};
undefined
temp['delhi'];
43
var temp = [10,20,30,40,11, 22,44,21,20];
undefined
typeof temp;
'object'
var e = {id:1001, name:}
VM1751:1 Uncaught SyntaxError: Unexpected token '}'
var e = {id:1001, name:'Amit'};
undefined
typeof e;
'object'
var x = [10,20];
undefined
var y = x;
undefined
y;
(2) [10, 20]
x;
(2) [10, 20]
y[0] = 1000;
1000
y;
(2) [1000, 20]
x;
(2) [1000, 20]
var t = "Amit";
undefined
typeof t;
'string'
var s = [10,20];
undefined
s = null;
null
var a= 10;
undefined
a = null;
null
typeof (a);
'object'
typeof a;
'object'
a= 10;
10
b = "10";
'10'
a==b;
true
a===b;
false