//判断给定字符串是否是回文 function isPalindrome(word) { return word==word.split("").reverse()join(""); } alert(isPalindrome("hello")); alert(isPalindrome("racecar"));
javascript判断给定字符串是否是回文
好好学习,天天向上。
//判断给定字符串是否是回文 function isPalindrome(word) { return word==word.split("").reverse()join(""); } alert(isPalindrome("hello")); alert(isPalindrome("racecar"));