Question: 6 . 1 5 LAB: JavaScript loops Download the ZIP file below containing HTML and JavaScript files. Complete the drawTriangle ( ) function in script.js
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 outputs to the console a triangle with trianglesize so the longest side 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
