Code to check whether given string is a Palindrom or not function palindrome(str) { // Good luck! var revers = str.split(“”).reverse().join(“”).toLowerCase().replace(/\W/g, ”).replace(“_”,””); var actualStr =str.toLowerCase().replace(/\W/g, ”).replace(“_”,””); console.log(revers +” : “+actualStr); if(revers === actualStr) {return true;} return false; }

Read More →