I have made a slideshow which shows exactly a random slogan, but when I check in the console, some of the slogans will be repeated twice of even three times. That is exactly what I want to avoid, but how can I implement that into my codes below.
setInterval("insertText()", 9000);
function insertText() {
var i = Math.floor(slogan.length * Math.random());
var text = document.getElementById("textinsidebox");
var sloganInfo = "<img src=" + slogan[i].image + " id='img_slogan'>" + "<br>" + slogan[i].text + "<br>" + slogan[i].person;
text.innerHTML = sloganInfo;
}