Question: 6 . 1 5 LAB: JavaScript loops Download the ZIP file below containing HTML and JavaScript files. Complete the drawTriangle ( ) function in script.js

6.15 LAB: JavaScript loops
Download the ZIP file below containing HTML and JavaScript files. Complete the drawTriangle () function in script.js that draws a
triangle with asterisks {:?**) based on the trianglesize parameter.
Ex: drawTriangle (4) outputs to the console a triangle with trianglesize 4, so the longest side (4 asterisks) appears on the
bottom line:
****
*******
**********
Hint: Use a loop inside a loop to complete drawTriangle (). The outer loop is responsible for outputting each asterisk line, and the
inner loop is responsible for building the asterisk line with the appropriate length by concatenating asterisks to a single string.
To test the JavaScript in your web browser, call drawTriangle () from the JavaScript console.
 6.15 LAB: JavaScript loops Download the ZIP file below containing HTML

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!