One way to do it is to use a while loop to generate the random numbers, and keep an object of used values to check if the value has been used or not.
2 things that I think are worth mentioning here:
1) As others have mentioned, if you have more than 90 values, you must have duplicates
2) Usually when I do something like this, depending on what I'm trying to do, I create a threshhold for how many loop iterations I allow before moving forward. One example that jumps to mind is a random color generator that ensures that any two colors are "not too similar". After x number of loop iterations, though, I just use the color and move on so it does not lock down the browser and significantly impact performance. It really depends on what you're trying to do.
I will leave adding the tolerance and > 90 values as an exercise for you, but here is the basic idea:
function setUpEventHandlerForShowBallButton() {
var myshowballbutton = document.getElementById('showball'); // local variable
myshowballbutton.addEventListener('click', function() {
// Generate a random number then draw a circle to display it
// for loop not really needed if only displaying one ball
var usedValues = {};
var randomNumber;
for (var i = 0; i < numberOfCircles; i++) {
while (typeof randomNumber === "undefined" || typeof usedValues[randomNumber] !== "undefined") {
randomNumber = Math.floor(Math.random() * 90 + 1);
}
usedValues[randomNumber] = randomNumber;
drawCircle(myContext, circleCentreX, circleCentreY, circleRadius, circleColours[0], randomNumber);
//circleCentreX += circleOffsetX; // The adds the offset to the current x coord.
}
}, false);
}