0👍
try like this
var a =[11111, 22222, 33333, 44444, 55555, 66666, 77777 ];
var f =[[Math.floor(a[0]/10000),a[0]]];
var z = []
for(var i=0;i<a.length;i++){
f =[[Math.floor(a[i]/10000),a[i]]];
z.push(...f);
}
console.log(z);
0👍
Maybe this will help?
var t = ['11111', '222222','333333','444444'].map(function(item, index) {
return {
item, index
};
});
Source:stackexchange.com