Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

2. How will the team select a leader?

Answered: 1 week ago