-
Notifications
You must be signed in to change notification settings - Fork 7
/
console-1659517889154.log
61 lines (61 loc) · 1.09 KB
/
console-1659517889154.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
const MAX = 100;
undefined
MAX++;
VM546:1 Uncaught TypeError: Assignment to constant variable.
at <anonymous>:1:4
(anonymous) @ VM546:1
const ARR = [10,20,30,40];
undefined
ARR[0] =1000;
1000
var obj = {id:101, name:'Amit' 1:'P',2:'A'};
VM751:1 Uncaught SyntaxError: Unexpected number
var obj = {id:101, name:'Amit', 1:'P',2:'A'};
undefined
obj.id;
101
obj.name;
'Amit'
obj['id'];
101
obj.1;
VM873:1 Uncaught SyntaxError: Unexpected number
obj[1];
'P'
var obj2 = {first name:'Amit'}
VM966:1 Uncaught SyntaxError: Unexpected identifier
obj2['first name'] ='Amit';
VM1037:1 Uncaught ReferenceError: obj2 is not defined
at <anonymous>:1:1
(anonymous) @ VM1037:1
var obj2 = {};
obj2['first name'] ='Amit';
'Amit'
obj2;
{first name: 'Amit'}
obj;
{1: 'P', 2: 'A', id: 101, name: 'Amit'}
var t = 1;
undefined
obj[t];
'P'
obj.t;
undefined
obj;
{1: 'P', 2: 'A', id: 101, name: 'Amit'}
for(let key in obj){
console.log(key);
}
VM1302:2 1
VM1302:2 2
VM1302:2 id
VM1302:2 name
undefined
for(let key in obj){
console.log(key, obj[key]);
}
VM1354:2 1 P
VM1354:2 2 A
VM1354:2 id 101
VM1354:2 name Amit
undefined