fasttestWhich is Possibly the easiest way to create an array with unique elements in it code example
Example 1: js unique using set
let uniqueArray = [...new Set([5,5,2,2,2,4,2])];
Example 2: how to create an array with unique values
import java.util.Random;
public class GenRandArray {
static Random rand = new Random();
public static void fillInt( int[] fillArray ) {
rand.setSeed(System.currentTimeMillis());
for(int i = 0; i < fillArray.length; i++)
{
fillArray[i]= rand.nextInt();
for (int j = 0; j < i; j++)
{
if (fillArray[i] == fillArray[j])
{
i--;
}
}
}
}
}