I have an array, to which I am putting random numbers from 1 to 50.
What I need is to compare the next number with those inside the array to avoid having any repeated.
I have this:
//ARRAY con los numeros del 1 al 50
var aNumeros=[];
for (let intI =1; intI<=50; intI++)
aNumeros.push(intI);
//ARRAY EN DONDE QUIERO METER LOS NUMEROS
aElegidos.push(aNumeros.splice(parseInt(Math.random()*aNumeros.length), 1));