Created
November 19, 2017 19:37
-
-
Save Elli-P/90818dd21a093ef6cf9b6286f4baaee7 to your computer and use it in GitHub Desktop.
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
var lines; | |
var length = tiers; | |
function buildTriangle(tiers){ | |
var triangle = ""; | |
for (var h = 1; h <= tiers; h++) { | |
lines = function makeLine(length) { | |
var line = ""; | |
for (var j = 1; j <= length; j++) { | |
line += "* "; | |
} | |
return line + "\n"; | |
} | |
triangle += line + "\n"; | |
return triangle; | |
} | |
} | |
console.log(buildTriangle (10)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:(