Created
November 13, 2018 09:45
-
-
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.
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
/* | |
* 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feedback
What Went Well
What Went Wrong
Feedback