2 ms·
Quite useful in situations such as: > (str.match(regexWithGroup) || [, null])[1] I.e. if the regex matches, then give me the first group (1st index) otherwise
by padolsey 7y ago
Quite useful in situations such as:
> (str.match(regexWithGroup) || [, null])[1]
I.e. if the regex matches, then give me the first group (1st index) otherwise give me null.