How do I code in JavaScript so that the number I enter forms that many rows of stars?

Viewed 12

I am quite new to coding and have been given an assignment which I have been struggling on this assignment. The problem is as followed:

Please enter a number. When the user clicks the SPACESHIP button a spaceship should appear. The spacehip should contain as many rows as the input number. For example, if the user enters "3", the spaceship will look like this:

*
**
***

If the user enters "5", the spaceship should look like this:

*
**
***
****
***** 
0 Answers
Related