I wonder how to write palindrome in javascript, where I input different words and program shows if word is palindrome or not. For example word noon is palindrome, while bad
Here's another way of doing it:
function isPalin(str) { str = str.replace(/\W/g,'').toLowerCase(); return(str==str.split('').reverse().join('')); }