palindromecheck

Solutions on MaxInterview for palindromecheck by the best coders in the world

showing results for - "palindromecheck"
Alizee
28 Aug 2019
1  function isPalindrome(value){
2    if(typeof value === 'number'){
3      return value === reverseInt(value)
4    }
5    return value === reverseString(value)
6  }
7
8function reverseString(value){
9    return value.split('').reverse().join('')
10  }
11  function reverseInt(value){
12    return parseInt(value.toString().split('').reverse().join(''))
13  }
14