Ok, you need to read a bit on JavaScript.
This is doesn't do what you think str[i]===/[^a-y]/
. You should use str[i].match(/[a-y]/i)
.
This doesn't do what you think: str[i] === 'a'||'e'||'i'||'o'||'u'
. It'll always return true. You'll want this str[i].match(/[aeiou]/i)
.