首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

去掉js数组中反复的数据

2012-09-04 
去掉js数组中重复的数据for(var j0jtemp.lengthj++){for(var fj+1ftemp.lengthf++){if(temp[j]t

去掉js数组中重复的数据

for(var j=0;j<temp.length;j++){    for(var f=j+1;f<temp.length;f++){         if(temp[j]==temp[f]){     temp.splice(j,1);            j--;     break;      }   }}

?

热点排行
Bad Request.