Dear all,
I have been trying to use a match method in an exercise of hackerrank .
It seems the parameter I am giving to the exercise is not defined.
Can anyone help me please:
The parameter is word .
function vowelsAndConsonants(word){
let vowels = word.match(/[o]/gi);
for(let value of vowels){
console.log(value);
}
let consonants = s.match(/[wrd]/gi);
for(let value of consonants){
console.log(value);
}
}
console.log(vowelsAndConsonants(word));