Tell us what’s happening:
I was testing to see if i can get the same answer using /a|e|i|o|u/gi
instead of /[aeiou]/gi
. Why is the result false? The arrays in result1 and result2 appear to be identical.
Your code so far
let quoteSample = "Beware of bugs in the above code; I have only proved it correct, not tried it.";
let vowelRegex1 = /[aeiou]/gi; // Change this line
let vowelRegex2 = /a|e|i|o|u/gi;
let result1 = quoteSample.match(vowelRegex1); // Change this line
let result2 = quoteSample.match(vowelRegex2); // Change this line
console.log(result1===result2)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
.
Challenge: Match Single Character with Multiple Possibilities
Link to the challenge: