Last active
August 29, 2017 12:51
-
-
Save Prosen-Ghosh/2453030a4ae267e5824d63e0d733e4f5 to your computer and use it in GitHub Desktop.
Check palindrome string using map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let str = "123211"; | |
let map = Array.prototype.map; | |
let newStr = map.call(str,function(x){ | |
return x; | |
}).reverse().join(''); | |
if(str === newStr)console.log("Palindrome"); | |
else console.log("Not Palindrome"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment