var a = [{x:1}, {y:1}, {z:3}]; var b = a.concat(['gg', 'ff']); var c = []; c.push(a[1]); console.log(a[1] === b[1]); console.log('--------'); console.log( c[0]=== a[1] );
可以看到,數組的concat方法並沒有在內存中重新開辟區域存數組a的三個對象,僅僅是指向a里三個對象的指針,數組的大多數原生方法都是如此,操作地址指針。