function vowelIndices(word){
var v = /[aeiouyAEIOUY]/g;
return word.split("").map((e, i) => v.test(e) ? (i+1) : 0).filter(e => e !=0)
}
var s = "supercalifragilisticexpialidocious"
console.log(s[24], vowelIndices(s)) // returns a [2,4,7,9,12,14,16,19,21,24,27,29,31,33]
//expected to return [ 2, 4, 7, 9, 12, 14, 16, 19, 21, 24, 25, 27, 29, 31, 32, 33 ]
// instead it returns [2,4,7,9,12,14,16,19,21,24,27,29,31,33]
How come my code doesn’t catch the a in “alidocious” and the other vowels?