AI

Clean and transform strings with .trim(), .replace(), and .replaceAll().

Your Task:

  • Use .trim() on messy to remove leading/trailing whitespace → cleaned
  • Use .replace() on cleaned to replace the first 'error' with 'success' → fixed
  • Use .replaceAll() on text to replace all 'old' with 'new' → updated
TypeScript Solution
Loading...

Submit your code to see test results