im trying to get a diffrent values of the array and print them each time the user clicking the button.
`
<p id="demo" style="display: none"></p>
<button
id="myB"
onclick="loto()"
style="background: #26a775; font-family: Monospace; border-radius: 15%"
>
And The Numbers Are
</button>
<script>
const lottery = [];
function loto() {
for (let i = 0; lottery.length < 7; i++) {
let index = Math.floor(1 + Math.random() * 32);
if (!lottery.includes(index)) {
//if lottery not includes this specific index >>
lottery.push(index);
} //push the index
demo.style.display = "block";
demo.style.color = "#ff7300";
demo.innerHTML = lottery;
}
}
console.log(lottery);
</script>
`