/* * 1, form a global scope (stack memory) * 2, code executes from top to bottom * 1. * n:10 * m:obj. N *10 =>obj. N At this time, the heap memory information has not been stored, the address of the space has not been given to OBj, at this time obj is undefined. obj.n<=>undefined.n */ var obj = { n: 10, m: obj.n * 10 //=>Uncaught TypeError: Cannot read property 'n' of undefined }; console.log(obj.m);Copy the code
var ary1 = [3, 4];
var ary2 = ary1;
ary2[0] = 1;
ary2 = [4, 5];
ary2[1] = 2;
ary1[1] = 0;
Copy the code