Dark Souls,
<script>
function fn(obj, num) {
return Object.keys(obj).reduce(function(a, b, i) {
i = i / num | 0;
a[i] ? a[i][b % num] = obj[b] : a[i] = {0:obj[b]};
return a;
}, {});
}
;
var d = {}; //для примера
for (var i=0; i<50; i++) {d[i] = {"name":"Vsya"}}
document.write(JSON.stringify(fn(d, 5)))
</script>