Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radovansurlak/b365166cfc8cc4bde28c32241a595748 to your computer and use it in GitHub Desktop.
Save radovansurlak/b365166cfc8cc4bde28c32241a595748 to your computer and use it in GitHub Desktop.
Eloquent JS Challenge - Looping a Triangle
function triangle (width, symbol = '#') {
width > 0 ? (console.log(symbol), triangle(width-1, symbol+symbol[0])) : null ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment