main.js 241 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
function esPalindrome(palabra) {
    var conReversa = palabra.length;
    for (let i = 1; i <= (palabra.length) / 2; i++) {
        if (palabra[i - 1] != palabra[conReversa - i]) {
            return false;
        }
    }
    return true;
}