/* 值类型 */n1 = 123;n2 = n1; //赋值n2 = 456;alert(n1); //123; n1 != n2/* 对象类型 */arr1 = [123];arr2 = arr1; //引用arr2[0] = 456;alert(arr1[0]); //456; arr1 === arr2
本文共 225 字,大约阅读时间需要 1 分钟。
/* 值类型 */n1 = 123;n2 = n1; //赋值n2 = 456;alert(n1); //123; n1 != n2/* 对象类型 */arr1 = [123];arr2 = arr1; //引用arr2[0] = 456;alert(arr1[0]); //456; arr1 === arr2
转载于:https://www.cnblogs.com/del/archive/2012/03/19/2405619.html