Someone explain this code to me?

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;
}

yes this is a regular expression solution. You will study it later in the javascript section if you haven’t yet.

as for j, that’s just a variable name.
you can use what you like but try to use something meaningful…

Thank you as always.