Hi, my code can’t pass the test, but I think it works. I found a post where somebody advised, that numbers should not be included, but it didn’t resolve my problem.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function removeSpecialChars(str) {
const regex = /[^[a-z0-9]]*/ig;
str = str.replace(regex, "");
return str;
}
console.log(removeSpecialChars(`"chujDUIA''asd'"854237856'`))
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0
Unless you want to earn a certificate but that doesn’t Help in any way in relation to skills and handling real world problems which would in turn count during interviews. You’ve to train your mind to think logically understand concepts and not just completing challenges
But my code was working. Okay, I should have added the \s to the regex. I didn’t test that, but I wouldn’t have tested the hyphen if the underscore and other special characters should be excluded.
Someone on the forum would have told me that. This way was quicker though, so I don’t think your remarks on my learning process are accurate this time.