Skip to content

Instantly share code, notes, and snippets.

@fusionstrings
Created February 20, 2014 14:23
Show Gist options
  • Save fusionstrings/9114724 to your computer and use it in GitHub Desktop.
Save fusionstrings/9114724 to your computer and use it in GitHub Desktop.
Check Palindrome
var checkPalindrome = function(str){
var strArr = str.split('');
var strArrReverse = strArr.slice(0).reverse();
console.log(strArr, strArrReverse, strArr.length);
var compareArr = function(){
for (var i = 0; i < strArr.length; i++){
return strArr[i] !== strArrReverse[i] ? false : true
}
}
return compareArr();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment