JSFiddle - React, Tailwind, and code Playground
JavaScript
var arr = [];
while(arr.length < 10) {
var aleatorio = Math.round(Math.random()*100);
if(arr.indexOf(aleatorio) < 0) {
arr.push(aleatorio);
}
};
console.log(arr);
var arr = [];
while(arr.length < 10) {
var aleatorio = Math.round(Math.random()*100);
if(arr.indexOf(aleatorio) < 0) {
arr.push(aleatorio);
}
};
console.log(arr);