Learn localStorage by Building a Todo App - Step 67

Tell us what’s happening:

Nothing that I put inside the function works. It always says that I should not remove spaces regardless of what I put inside the function, even nothing at all.

Your code so far

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

/* file: styles.css */

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

function removeSpecialChars() {

}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

Challenge Information:

Learn localStorage by Building a Todo App - Step 67

It would be a good idea to see what you have used here, you need the regex code that only allows Caps, lowercase and numbers because that’s the solution. return code [^A-Za-z0-9-\s] also you will need a parameter as well

1 Like

function removeSpecialChars(input) {
return input.replace(/[^A-Za-z0-9-\s]/,“”);
}
Now it says I need to remove double quotes and underscores

Good job, the code works you just need the g flag.