I have to generate combinations for in array like this:
let arr = []
for(let x=1;x<=10;x++) {
for(let y=1;y<=12;y++) {
for(let z=1;z<=16;z++) {
arr.push([x, y, z])
}
}
}
return arr
It correctly generates [[1,1,1], [1,1,2]...[10,12,16]].
However i want to make the code looks and feel better.
I try to convert as pretty as I can and use functional approach (map, reduce and so on).
I tried with 3 maps but the code got uglier.
Try to make the code less characters but without neglecting code readabilty.
Any answer is appreciated and you can use lodash/underscore/ramda if you want to.