Skip to content

Instantly share code, notes, and snippets.

@Elli-P
Created November 19, 2017 19:37
Show Gist options
  • Save Elli-P/90818dd21a093ef6cf9b6286f4baaee7 to your computer and use it in GitHub Desktop.
Save Elli-P/90818dd21a093ef6cf9b6286f4baaee7 to your computer and use it in GitHub Desktop.
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));
@maxichrome
Copy link

var length = tiers;
             ^

ReferenceError: tiers is not defined

:(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment