Write a JS function that outputs a triangle made of stars with variable size, depending on an input parameter. Look at the examples to get an idea. The input comes as a single number argument.
Examples:
Input:
1
Output:
*
Input:
2
Output:
*
**
*
Input:
5
Output:
*
**
***
****
*****
****
***
**
*
The output is a series of lines printed on the console, forming a triangle of variable size.