Learn localStorage by Building a Todo App - Step 65

Tell us what’s happening:

I suspect I have made a small typo or formatting error.
Yes I know there is a shorter way but I am working through the old syllabus and have not been taught this.
This code comparable to what I used for validation project with the space in the string, being the most notable difference. So I feel it is unlikely it is the method which is the issue.

Your code so far

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

/* file: styles.css */

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

function removeSpecialChars(string){
  let cleanedString="";
  const nonSpecial="0123456789abcdefghijklmnopqrstuvwxyz ";
  const lCString=string.toLowerCase();
  for(let i in lCString){
    for(let j in nonSpecial){
      if (lCString[i]===nonSpecial[j]) {
        cleanedString+=lCString[i];
      }
    }
  }
  return cleanedString;
}

// 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/137.0.0.0 Safari/537.36 Edg/137.0.0.0

Challenge Information:

Learn localStorage by Building a Todo App - Step 65

Are capital letters special characters? Are numbers usually found in words?

1 Like

Thankyou I initially was going to say the toLowerCase was there for capitals and then realised. Step completed thankyou.

If you are wondering why I have not ticked solution that is because I feel they should be one post covering everything ,which I will do when I have time.

Posted in wrong thread