I solved a simple function of removing all the vowels out of a sentence and then found this solution trying to simplify it. Is this what people call regex? Why did the person use “j” instead of anything else. I know typically people use “i” or “j”, but why “j” in this case, is it simply just arbitrary? So, anything in the forward slashes and brackets will be replaced with what is after the comma (an empty space). What do the “g” and “i” stand for? Global…and?
Thank you all so much.
function disemvowel(str) {
let j = str.replace(/[aeiou]/gi, '');
return j;
}