I tried it in the browser console and node.js and it works but for some reason freeCodeCamp can’t test this (the flasks don’t change into anything)
"use strict";
const normalize = function normalize(x) {return x.match(/\w/g).join('').toUpperCase();};
const isPalindrome = function isPalindrome(a,equal = (a,b) => a===b) {
for(let s=0,e=a.length-1;s<e;s++,e--) if (!equal(a[s],a[e])) return false;
return true;
};
function palindrome(str) {
return isPalindrome(normalize(str));
};
palindrome("eye");
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker