printing step
problem
solution
function printStep(n) {
for(let i = 1; i <= n; i++) {
let str = ''
for(let j = 1; j <= n; j++) {
if(j <= i) {
str += '#'
} else {
str += ' '
}
}
console.log(str)
}
}Last updated