So, i been getting this kind of output lately when im coding but i just want to make sure its normal or maybe im doing something wrong. Here is a simple code.. maybe it has to do with regex.
my console says " (1) ['a', index: 1, input: 'karina', groups: undefined] "
function reg(s) {
reg = /[aeiou]/;
console.log(s.match(reg));
}
reg("turtle");
reg("turtle");and then get['a', index: 1, input: 'karina'you have an issue but you are not showing the right code..matchwithout thegflag on your RegExp returns an Array of the first match followed by parenthetical subpatterns.