Created
September 21, 2018 15:07
-
-
Save spektraldevelopment/af2a04614c0546955f5da424971e3beb to your computer and use it in GitHub Desktop.
JS: Steps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function steps(n) { | |
for (let row = 0; row < n; row++) { | |
let stair = ""; | |
for (let column = 0; column < n; column++) { | |
if (column <= row) { | |
stair += "#"; | |
} else { | |
stair += " "; | |
} | |
} | |
console.log(stair); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment