Question: Complete the drawTriangle() function in script.js that draws a triangle with asterisks (*) based on the size parameter. Ex: drawTriangle(4) outputs to the console a

Complete the drawTriangle() function in script.js that draws a triangle with asterisks (*) based on the size parameter. Ex: drawTriangle(4) outputs to the console a triangle with size 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 the 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. 454872284805.p03 proy? \begin{tabular}{l|l} LAB & 1.15.1: LAB: JavaScript loops \end{tabular} 0/10 Submission Instructions Downloadable files and Upload your files below by dragging and dropping into the area or choosing a file on your hard drive. script.js File added Remove Coding trail of your work 2/3EO,0,0,0UO,0,0,0MO,0min:8 Latest submission - 6:55 PM EST on 03/06/23 Total score: 0/10 Only show failing tests 1:QUnit test 0/3 Test triangle with size 4 X drawTriangle(4) draws a triangle of size 4 Your value Expected value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
