问题描述 找出两数组中不同的数据,并查看他们在以前数组中的索引值 var aa = [1,21,21,21,28]; var bb = [3,4,27,39,21]; var cc = []; var tmp = aa.concat(bb); var o = {}; for (var i = 0; i < tmp.length; i ++){ (tmp[i] in o) ? o[tmp[i]] ++ : o[tmp[i]] = 1; } for (x in o){ if (o[x] == 1){