Skip to content

Instantly share code, notes, and snippets.

@youngjinmo
Created November 13, 2018 09:45
Show Gist options
  • Save youngjinmo/695954c8c1f13bb773d2f7f529c6c9a1 to your computer and use it in GitHub Desktop.
Save youngjinmo/695954c8c1f13bb773d2f7f529c6c9a1 to your computer and use it in GitHub Desktop.
Failed my first answered that quiz 5-3 in Intro to JavaScript at Udacity.
/*
* Programming Quiz: Build A Triangle (5-3)
*/
// creates a line of * for a given length
function makeLine(length) {
var line = "";
for (var j = 1; j<=length; j++) {
line += "* ";
}
return line;
}
// your code goes here. Make sure you call makeLine() in your own code.
function buildTriangle(width){
for(var i=1; i<=width; i++){
console.log(makeLine(i));
}
}
// test your code by uncommenting the following line
buildTriangle(10);
@youngjinmo
Copy link
Author

youngjinmo commented Nov 13, 2018

Feedback

What Went Well

  • Your code should have a buildTriangle() function
  • Your buildTriangle() function should take one argument

What Went Wrong

  • Your buildTriangle() function doesn't build a triangle of the correct size

Feedback

  • Not everything is correct yet, but you're close!

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