What does this expression return?
'cost'.replace(/cost/, '$$5')
- '$5'
- '$$5'
- 'cost5'
- '5'
In a replacement string
Play Regex ▸
$$ is the escape for a single literal $.'cost'.replace(/cost/, '$$5')
$$ is the escape for a single literal $.