Write the printNumbers () function, which takes two integer values: num - a finite number of cols - the number of columns and displays numbers from 0 to num in the following order printNumbers (12, 3)
0 4 8 1 5 9 2 6 10 3 7 11 output is desirable via console.log
UPD: I tried while it is primitive to output 0 4 8 into one line, and how to display them in this way until I thought of it
var num = 5; var n1 = 0; var res = 0; console.log(n1) for (i=0; i<=3; i++){ res = res + n1 +(num-1); console.log(res); }