Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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(height){
- for ( var i = 0; i < height; i++){
- console.log(makeLine(i + 1));
- }
- }
- // test your code by uncommenting the following line
- console.log(buildTriangle(10));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement