Build a Todo App using Local Storage - Step 66

Tell us what’s happening:

I am a little bit confused here. I used regex to remove all special characters but somehow my code still fails

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const removeSpecialChars = str => {
  str.replace(/[^A-Za-z0-9]/g, " ")
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36

Challenge Information:

Build a Todo App using Local Storage - Step 66

Hi there!

const removeSpecialChars = str => {
str.replace(/[^A-Za-z0-9]/g, " ")
}

What is your function returning?

Wouldn’t a space be acceptable?

Do you want to replace with a space?

Should digits be allowed?

Happy coding!

1 Like

Thank you, I fogot space was not a character too

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.