I am not clear on how the below recursive case counts vowels.
Although typing it I realize that it is probably casting the bool to a number by +.
return ("aeiouAEIOU".indexOf(string[0]) != -1) + foo(string.slice(1));
I am not clear on how the below recursive case counts vowels.
Although typing it I realize that it is probably casting the bool to a number by +.
return ("aeiouAEIOU".indexOf(string[0]) != -1) + foo(string.slice(1));
Can you please tell the lesson or chapter name