To get a random whole number between 0 and 4 inclusive, I use the following code:
var random = Math.floor(Math.random() * 5);
However I want the number 4 to be chosen twice as often as the other numbers. How would I go about doing getting a random number between 0-4 inclusive, but with the number 4 appearing twice as many times as 0-3?