Your task is to extend the functionality of the generatePattern(style, dimensions) function to support a new pattern type: triangle.
For this assignment, the style parameter will be "triangle", and the dimensions parameter will be an array containing a single number [size] where:
sizespecifies the number of rows in the triangle.- The width of each row corresponds to its row number (1-based). For example, the 1st row has 1
*, the 2nd row has 2*, and so on.