You are viewing a single comment's thread. Return to all comments →
Same solution:
for(let symbols = 1, spaces = n - 1; symbols <= n; symbols++, spaces--) { const result = [...Array(spaces).fill(" "), ...Array(symbols).fill("#")] console.log(result.join("")); }
Staircase
You are viewing a single comment's thread. Return to all comments →
Same solution:
for(let symbols = 1, spaces = n - 1; symbols <= n; symbols++, spaces--) { const result = [...Array(spaces).fill(" "), ...Array(symbols).fill("#")] console.log(result.join("")); }