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
You could also do something like this :
function isPalindrome(str) { var newStr = ''; for(var i = str.length - 1; i >=0; i--) { newStr += str[i]; } if(newStr == str) { return true; return newStr; } else { return false; return newStr; } }