My program in js. What I want to do is that every time a button with a function is pressed, this is activated, but the problem is that the result is repeated often and is annoying.
var Loot = ["manzana", "pera","melon","sandia","limón","durazno"];
var Hrandom = Loot[Math.floor(Loot.length * Math.random())];
document.getElementById("demo").innerHTML =""+Hrandom;
I'm still noob, but I want to do it when I can. I know he's missing something ... something tells me he's missing an IF, but I do not know where. Or maybe a loop.
I just want apple, lemon ... etc. to come out ... no lemon, lemon, apple ... I just want it not to happen again two or three times in a row, that's all, thank you.