Tell us what’s happening:
Hello,
can’t find out why ‘filtered’ var can’t filter digits from ‘toReduce’ array? I’ve tried to filter letters from the ‘toReduce’ array like “o” and it works out. On the other hand I just can’t filter digits. Anyone can help here?
Your code so far
function palindrome(str) {
// Good luck!
var lowLetter = str.toLowerCase();
var toReduce = lowLetter.split("");
var filtered = toReduce.filter(function(x) {
return x != /\d/gi;
});
return filtered;
}
palindrome("8not a palindrome8");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
.
Link to the challenge: