I want my program to check if any two consecutive words in the array are the same. I believe that my "if" statement is correct, however the console.log shows that all consecutive words match. What am I miss here?
Any help appreciated! I'm new to this stuff :)
var wordArray = ["blue", "green", "yellow", "red", "red", "blue", "blue", "yellow"]
for (i=0; i<wordArray.length - 1; i++) {
if (i === i+1); {
console.log("We have a match!");
} //Why is this loop saying that all items in the array are equal?
}