Skip to content

Instantly share code, notes, and snippets.

@tejuafonja
Created October 14, 2017 15:18
Show Gist options
  • Save tejuafonja/79822bc55d642c1783a4ca529423c468 to your computer and use it in GitHub Desktop.
Save tejuafonja/79822bc55d642c1783a4ca529423c468 to your computer and use it in GitHub Desktop.
function staircase(n) {
for (var i=0; i<n; i++) {
var space = n-i-1
var stairs = ' '.repeat(space) + '#'.repeat(i+1)
console.log(stairs)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment