Now, let it be known I've looked all over and I've been unable to find an answer to the specific problem I've got. I'm very new with JS and I've been trying to teach myself, so I'm probably making a very basic, "noob" mistake.
So apologies in advance.
I'm trying to make a "random generator" of sorts, basically pulling two words from a given list and I'm not quite sure how to avoid duplicate results from appearing.
I suppose I'm doing something wrong in the following code:
var randomDiv = document.getElementById("myRandomDiv");
document.getElementById("myButton").addEventListener("click", function() {
randomIndex = Math.ceil((Math.random()*randomStrings.length-1));
randomIndex2 = Math.ceil((Math.random()*randomStrings.length-1));
newText = randomStrings[randomIndex]+" + ";
newText2 = randomStrings[randomIndex2];
randomDiv.innerHTML = newText+newText2;