Tell us what’s happening:
I’m getting an error that says im not using ![“+”, “-”, “”].includes() in my code. The code is supposed to check to see if there is any of those strings in the array and if not is pushes the string onto the clearStrArray. Can anyone tell me what I’m missing please?
Your code so far
function cleanInputString(str) {
const strArray = str.split('');
const cleanStrArray = [];
for (let i = 0; i < strArray.length; i++) {
let character=strArray[i];
if(!["+","-",""].includes(character)){
cleanStrArray.push(character);
}
}
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0 (Edition std-1)
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 22