What does this expression return?
'a b c'.replace(/\s+/g, ' ')
- 'a b c'
- 'abc'
- 'a b c'
- 'a b c'
\s+ matches each run of whitespace, which is collapsed into a single space.'a b c'.replace(/\s+/g, ' ')
\s+ matches each run of whitespace, which is collapsed into a single space.