$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · easy · #87

What is the output?

console.log('aaa'.replace('a', 'b'));
  1. baa
  2. bbb
  3. aaa
  4. ba
A string pattern replaces only the first match; /a/g replaces them all.
Play Problem Solving ▸