verificar palindromo javascript code example
Example 1: palindrome javascript
function palindrome(str) {
var splitted = str.split("");
var reversed = splitted.reverse("");
var joined = reversed.join("");
return joined.toLowerCase().replace(/[^0-9a-z]/gi, '') == str.toLowerCase().replace(/[^0-9a-z]/gi, '')
}
Example 2: palindrome javascript
const reverseString = string.split('').reverse().join('');