Javascript's Math.random() returns a psuedo-random number with "uniform" distribution.

I need to generate a random number in the range [0,1] that is skewed to either side. (Meaning, higher chance of getting more numbers next to 0 or next to 1)

Ideally I would like to have a parameter to set this curve.

I supposed I can do Math.random^2 to get such a result, but what more sophisticated ways are there to achieve this?

Edit
Report