标签:[] nbsp div span var 数组 个数 循环 class
1 var id = [‘a‘,‘b‘,‘c‘,‘a‘,‘d‘,‘a‘,‘a‘,‘b‘,‘d‘,‘c‘,‘a‘,‘b‘,‘c‘,‘a‘,‘b‘,‘c‘] 2 var del = [‘a‘,‘c‘]; 3 var temp01 = []; 4 var temp02 = []; 5 6 for(var i in del){ 7 temp01[del[i]] = true; 8 } 9 10 for (var k in id){ 11 if(!temp01[id[k]]){ 12 temp02.push(id[k]) 13 } 14 } 15 16 console.log(temp02);
标签:[] nbsp div span var 数组 个数 循环 class
原文地址:http://www.cnblogs.com/YKSlu/p/7668095.html