$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #26

Which fix removes the bug?

const s = "racecar";
const rev = s.split("").reverse().join;
  1. Change join to join("")
  2. Change reverse() to reverse
  3. Use s.reverse()
  4. Remove split("")
join must be called with parentheses to produce a string.
Play Problem Solving ▸