I'm very new to JavaScript and came across an exercise solution that I want to fully understand.
The exercise asked to remove all vowels from a string. The solution:
function disemvowel(str) {
return str.replace(/[aeiou]/gi, '');
}
I understand the basic syntax:
whatever is between the /'s is what you want replaced
second parameter is what to replace it with
/g is a 'global tag'....? so not just the first instance
My questions:
What do the brackets in the solution represent?
What is the i after /g? I read that it means ignore, but what is it ignoring?
Thank you for any info!! :)