-
Notifications
You must be signed in to change notification settings - Fork 12
/
console-1690346926291.log
80 lines (80 loc) · 1.08 KB
/
console-1690346926291.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
function add(x,y){
return x + y;
}
undefined
add(10,20);
30
add();
NaN
function add(x=0,y=0){
return x + y;
}
undefined
add();
0
add(10);
10
add(10,20);
30
var arr =[10,20,30];
undefined
arr.length;
3
arr = null;
null
arr.length;
VM331:1 Uncaught TypeError: Cannot read properties of null (reading 'length')
at <anonymous>:1:5
(anonymous) @ VM331:1
if(arr!=null){
console.log(arr.length);
}
undefined
if(arr){
console.log("Array Present ", arr.length);
}
else{
console.log("Array is Not Present");
}
VM582:5 Array is Not Present
undefined
arr;
null
arr = undefined;
undefined
if(arr){
console.log("Array Present ", arr.length);
}
else{
console.log("Array is Not Present");
}
VM636:5 Array is Not Present
undefined
arr=[10,20];
(2) [10, 20]
if(arr){
console.log("Array Present ", arr.length);
}
else{
console.log("Array is Not Present");
}
VM684:2 Array Present 2
undefined
function add(x,y){
return x + y;
}
undefined
add();
NaN
function add(x,y){
x = x || 0;
y = y || 0;
return x + y;
}
undefined
add();
0
var o = {};
undefined
o.name;
undefined