Look at your code. If any two letters are the same vowel, i.e. are equal, then you return
false
. For anything else you return
true
. And since there is only one vowel in 'dog', the test:
if(newArray[i] === newArray[i+1]){
will fail and the return is as you have discovered.