encounters an algorithm; similar to var a = [1 br > how to deal with it into a two-digit array [[1], [2], [4Power4], [5Power5]] < beacon > I wrote it myself: uh. how to deal with it into a two-digit array [[1], [2], [4parry 4], [5pjre 5]]. Loop twice, not so good
var a= [1,2,3,4,4,5,5,5];
var obj = {};
var arr = [];
for(var i = 0; i<a.length; iPP) {
if(!obj[a[i]]){
obj[a[i]] = [];
}
obj[a[i]].push(a[i]);
}
for(var i in obj){
arr.push(obj[i]);
}
console.log(arr);