complete-intro-to-react-v5
complete-intro-to-react-v5 copied to clipboard
fix replace to replace all
Greetings,
Replace was replacing only the first occurrence, but it was meant to replace all, as per the example explained in the v5 course.
It's a really common mistake; we forget about the quirky replace all the time! So I updated the code and added comments to help others avoid this mistake https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
Best Regards, Ahmed