loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const printStarLine = n => {
  if (n === 1) {
    return '*';
  }
  return printStarLine(n - 1) + '*';
};

const stars = n => {
  if (n === 0) {
    return '\n';
  }
  return stars(n - 1) + printStarLine(n) + '\n';
};

console.log(stars(15));
Native Browser JavaScript