This is the array:
array = [1, 6, 9, 10 , 15, 18, 20];
And a random number is being generated from 1 to 20, with the following code:
var x = Math.floor((Math.random() * 20) + 1)
How could I check if the generated number is already in the array above? If it is, I want to generate a new value so it does not repeat one of the values in the array.