日期:2014-05-16 浏览次数:20401 次
var arr1 = [1,1,1,2,2,3,3]; var arr2 = [[],[],[]]; for (x in arr1){ var i = arr1[x]-1; arr2[i].push(arr1[x]); } document.write(arr2);