reverse star pattern in javascript

Solutions on MaxInterview for reverse star pattern in javascript by the best coders in the world

showing results for - "reverse star pattern in javascript"
Aksel
19 Sep 2020
1let n = 5;
2let string = "";
3for (let i = 0; i < n; i++) {
4  // printing star
5  for (let k = 0; k < n - i; k++) {
6    string += "*";
7  }
8  string += "\n";
9}
10console.log(string);
similar questions
queries leading to this page
reverse star pattern in javascript