Answer:
const SIZE=8
function print(n, s) {
if (n > 0) {
process.stdout.write(s);
print(n-1, s);
}
}
function main(n=1) {
if (n<=SIZE) {
print(SIZE-n, " ");
print(n, "* ");
process.stdout.write("\n");
main(n+1);
}
}
main();
Explanation:
Here is a solution in javascript. Note that it uses recursion multiple times to avoid loops.