Learn localStorage by Building a Todo App -- Step 67

Hello, freeCodeCampers!

I’m really stuck on this function here. I’m supposed to make sure that it removes all special characters, but not whitespaces. What do I do?

function removeSpecialChars(string) {
  let regex = /^[a-z][A-Z][0-9 ]/g; 
  
  let newString = string.replace(regex, '')
  console.log(newString)
}
console.log(removeSpecialChars("@%#*()!#("))

I guess the tests are testing the output of your function, which is undefined right now

for next time please use the HELP button

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

Okay, I’ll remember that next time.

In the meantime, I’m unsure what this output actually means.

what does your function return? have you written the code to determine that?

Wait a second…
I realized that I had done the function wrong. It was supposed to RETURN the string, not log the string to the console. Thanks for all your help, anyway!