<input/>
<button>Compare com o meu segredo</button>
<script>
function sorteia(){
return Math.round(Math.random() * 10);
}
function sorteiaNumeros(quantidade){
var segredos = [];
var numero = 1;
while(numero <= quantidade) {
var numeroAleatorio = sorteia();
if (numeroAleatorio !==0){
var achou = false;
for(var posicao = 0; posicao < segredos.length; posicao++){
if(segredos[posicao] == numeroAleatorio) {
achou = true;
break;
}
}
}
if (achou == false){
segredos.push (numeroAleatorio);
numero++;
}
}
return segredos;
}
var segredos = sorteiaNumeros(10);
console.log(segredos);