$ ./guess_the_languageRegex
Regex · medium · #36

What happens when this runs?

'aaa'.replaceAll(/a/, 'b')
  1. TypeError
  2. SyntaxError
  3. 'bbb'
  4. 'baa'
replaceAll requires a regex with the g flag and throws a TypeError otherwise.
Play Regex ▸