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