You are viewing a single comment's thread. Return to all comments →
here is another very simple solution:
function staircase(n) { const s = "#"; for (let i = 1; i <= n; i += 1) { const line = " ".repeat(n - i) + s.repeat(i); console.log(line); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Staircase
You are viewing a single comment's thread. Return to all comments →
here is another very simple solution: