JSFiddle - React, Tailwind, and code Playground
by cncent454518
JavaScript
function g (){
let arr = []
let r = []
for(let i =1 ;i<=49 ;i++){
arr.push(i)
}
for(let i=1;i<=6;i++){
let y = getRandom(0,48)
if(arr.includes(arr[y])){
i--
}
r.push(arr[y])
console.log(arr[y])
}
function getRandom(min,max){
return Math.floor(Math.random()*max)+min;
}
}
g()