Here you can find the source of palindrome(str)
String.prototype.reverse = function(){ return this.split("").reverse().join(""); } function palindrome(str) { return str == str.reverse(); } console.log(palindrome("ingirumimusnocteetconsumimurigni"));
String.prototype.palindrome = function() { for (var i = 0; i <= this.length - 1; i++) { if (this.charAt(i) !== this.charAt(len - i)) { return false; if (i === (len - i)) { return true; return true; }; String.prototype.palindromeAdv = function() { var r = this.split("").reverse().join(""); return (r === this.valueOf()); };
'use strict'; String.prototype.palindrome = String.prototype.palindrome || function ( ) { if ( typeof this == 'string' ) { return this === this.split('').reverse().join(''); else { return false; }; ...
String.prototype.palindrome = function(loose) { var str = loose ? this.replace(/[^a-zA-Z0-9]+/gi, '').toLowerCase() : this; return str == str.split('').reverse().join('');
function palindrome(str) { str = str.replace(/[^a-zA-Z0-9]+/gi, '').toLowerCase(); return str == str.split('').reverse().join(''); palindrome("eye");
function palindrome(str) { var removeChar = str.replace(/[^A-Z0-9]/ig, "").toLowerCase(); var checkPalindrome = removeChar.split('').reverse().join(''); return (removeChar === checkPalindrome); palindrome("eye");
String.prototype.isPalindrome = function() { var str = this; var half = parseInt(str.length / 2, 10); for (var i = 0, last = str.length - 1; i < half; ++i) { if (str[i] != str[last - i]) return false; return true; };
String.prototype.isPalindrome=function(){ var palavra=this; for(var i=0;i<palavra.length/2;i++){ if(palavra[i]!=palavra[palavra.length-1-i]){ return false; return true;
String.prototype.isPalindrome = function() { var val = this.toString().toLowerCase(); var reverse = val.split('').reverse().join(''); return val === reverse; var str = 'something'; var result = str.isPalindrome(); var str2 = 'level'; var result2 = str2.isPalindrome(); ...
'use strict'; String.prototype.isPalindrome = String.prototype.isPalindrome || function () { let length = Math.floor(this.length / 2); for (let i = 0; i < length; i++) { if (this[i] !== this[this.length - i - 1]) { return false; return true; ...