forked from amitsrivastava4all/meanbatchmayreg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.log
More file actions
209 lines (209 loc) · 3.07 KB
/
Copy pathcode.log
File metadata and controls
209 lines (209 loc) · 3.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
function show(){
console.log("I am a function ");
}
undefined
show();
VM324:2 I am a function
undefined
var test = function(){
console.log("I am a Function Expression or Anonymous Function ");
}
undefined
typeof test;
"function"
test();
VM442:2 I am a Function Expression or Anonymous Function
undefined
typeof show;
"function"
x = 1000;
1000
typeof x;
"number"
if(typeof (x) =='number'){
}
undefined
if(typeof (x) =='number'){
console.log('x is a number ');
}
VM582:2 x is a number
undefined
if(typeof (x) =='function'){
console.log('x is a number ');
}
undefined
if(typeof (x) =='function'){
console.log('x is a function ');
}
undefined
typeof x;
"number"
show;
ƒ show(){
console.log("I am a function ");
}
typeof show;
"function"
x = show;
ƒ show(){
console.log("I am a function ");
}
x;
ƒ show(){
console.log("I am a function ");
}
typeof x;
"function"
if(typeof (x) =='function'){
console.log('x is a function ');
}
VM693:2 x is a function
undefined
z = 1000;
1000
r = "1000"
"1000"
x==z;
false
z==r;
true
x===z;
false
z===r;
false
function calc(){
var add = function(x, y){
return x + y;
}
var sub = function(){
return x - y;
}
return [add,sub];
}
undefined
var t = calc();
undefined
t;
(2) [ƒ, ƒ]0: ƒ (x, y)1: ƒ ()length: 2__proto__: Array(0)
function calc(){
var add = function(x, y){
return x + y;
}
var sub = function(x,y){
return x - y;
}
return [add,sub];
}
undefined
var t = calc();
undefined
t;
(2) [ƒ, ƒ]0: ƒ (x, y)1: ƒ (x,y)length: 2__proto__: Array(0)
t[0]
ƒ (x, y){
return x + y;
}
t[0]();
NaN
t[0](100,200);
300
t[1](10,20);
-10
calc()[0](10,20);
30
function calc(){
var add = function addition(x, y){
return x + y;
}
var sub = function subtraction(x,y){
return x - y;
}
return [add,sub];
}
undefined
var t = calc();
undefined
t;
(2) [ƒ, ƒ]0: ƒ addition(x, y)1: ƒ subtraction(x,y)length: 2__proto__: Array(0)
t[0]();
NaN
t[0](10000,2000);
12000
function calc(){
var add = function (x, y){
return x + y;
}
var sub = function (x,y){
return x - y;
}
return {'addition':add,'subtraction':sub};
}
undefined
var t = calc();
undefined
t;
{addition: ƒ, subtraction: ƒ}
typeof t;
"object"
t.addition(100,200)
300
var ram = {id:1001, name:'Ram ', marks:90};
undefined
var shyam = {id:1002, name:'Shyam'};
undefined
ram;
{id: 1001, name: "Ram ", marks: 90}
shyam;
{id: 1002, name: "Shyam"}
typeof ram;
"object"
typeof shyam;
"object"
ram instanceof Object;
true
shyam instanceof Object;
true
ram;
{id: 1001, name: "Ram ", marks: 90}
ram.award = "2019";
"2019"
ram;
{id: 1001, name: "Ram ", marks: 90, award: "2019"}
ram.job = "IT";
"IT"
ram;
{id: 1001, name: "Ram ", marks: 90, award: "2019", job: "IT"}
shyam;
{id: 1002, name: "Shyam"}
delete ram.job;
true
ram;
{id: 1001, name: "Ram ", marks: 90, award: "2019"}
var m = [10,20,30,40,50];
undefined
typeof m;
"object"
m instanceof Array;
true
typeof Array;
"function"
m instanceof Object;
true
var add = (x,y)=>x+y;
undefined
var addition = function (x,y){
return x + y;
}
undefined
typeof add;
"function"
add(10,20);
30
var add1 = (x,y)=>{
console.log('X is '+x+' And Y is '+y);
return x + y;
}
undefined
add1(1000,200);
VM1908:2 X is 1000 And Y is 200
1200