/* 值类型 */
n1 = 123;
n2 = n1;   //赋值
n2 = 456;
alert(n1); //123; n1 != n2

/* 对象类型 */
arr1 = [123];
arr2 = arr1;    //引用
arr2[0] = 456;
alert(arr1[0]); //456; arr1 === arr2

posted on 2012-03-19 10:02  万一  阅读(1591)  评论(2编辑  收藏  举报