//判断给定字符串是否是回文
    function isPalindrome(word) {
      return word==word.split("").reverse()join("");
    }
    
    alert(isPalindrome("hello"));
 
    alert(isPalindrome("racecar"));

 

相关文章: