What does this expression return?
'a1b2c3'.replace(/\d/, '')
- 'ab2c3'
- 'abc'
- 'a1b2c'
- '123'
Without the
Play Regex ▸
g flag, replace only replaces the first match.'a1b2c3'.replace(/\d/, '')
g flag, replace only replaces the first match.