日期:2014-05-16 浏览次数:20379 次
var my_arr = new Array(1,2,3,3,4,5,6,6,7,8,9,10,11,11,10,11,12,13); var p_v_copy = my_arr; for(var l = 0; l < my_arr.length; l++){ //初始重复判断变量 var no_repeat = 1; //查找积是否不重复 for(var m = 0; m < my_arr.length; m++){ if(l == m){ continue; } if(my_arr[l] == my_arr[m]){ no_repeat = 0; break; } } //积不重复时,删除复制数组里面的此值对 if(no_repeat){ p_v_copy[l] = 'mark'; } } document.write(my_arr + '<br />'); document.write(p_v_copy); var a = 3; var b = a; document.write(a + '<br />'); document.write(b + '<br />'); b = 4; document.write(a + '<br />'); document.write(b + '<br />');