What does this expression return?
['catfish', 'hotdog'].map(s => /^cat|dog$/.test(s))
- [true, true]
- [true, false]
- [false, true]
- [false, false]
Alternation has the lowest precedence, so the pattern means
Play Regex ▸
^cat OR dog$, not ^(cat|dog)$.