0
点赞
收藏
分享

微信扫一扫

判断是否回文

文风起武 2022-02-22 阅读 178
算法

1

function isPalindrome(str) {
  const newVal = str.split('').reverse().join('')
  return str === newVal
}

console.log(isPalindrome('abcdedcba'))

1

举报

相关推荐

0 条评论