According to your comments you can try this code. You only need one loop and should avoid splice since it's very costly and not needed if you want to replace just one single element at a time.
function test(a){
var l = a.toString().length;
var bb = [];
for (var i = l;i>0;i-=1){
bb[i-1] = ((l-i+2)%3!=0)?"a":"b";
}
console.log(bb);
}
test(1343332);