Given a string, return the string without numbers. For example: for the string, "I W4nt 2 Br3ak Fr33", it should return the string "I Wnt Brak Fr"
I am extremely new to this and have been in a coding boot camp with almost zero instruction to these more "complicated" functions.
I tried the following and in reverse I'll get a string of just numbers but with non-equality I return the original string still..
function removeNumbers(str) {
let arr = [];
for (let i = 0; i < str.length; i++) {
if (
str[i] != '0' ||
str[i] != '1' ||
str[i] != '2' ||
str[i] != '3' ||
str[i] != '4' ||
str[i] != '5' ||
str[i] != '6' ||
str[i] != '7' ||
str[i] != '8' ||
str[i] != '9'
) {
arr.push(str[i]);
}
}
return arr.join("");
}