Hello, I would like to apologize in advance for the somewhat weird english I'm going to write.

The problem is as follows, I need to make a program in javascript that creates a random monomial and then you have to solve it.

My isse is, how can I make the exponent look like the normal small number, for example:

This is how my exercise is shown: -18x2 when x is -54

I want it to show it like this: -18x˛ when x is -54

Any help would be greatly appreciated.