Skip to content

Instantly share code, notes, and snippets.

@Prosen-Ghosh
Last active August 29, 2017 12:51
Show Gist options
  • Save Prosen-Ghosh/2453030a4ae267e5824d63e0d733e4f5 to your computer and use it in GitHub Desktop.
Save Prosen-Ghosh/2453030a4ae267e5824d63e0d733e4f5 to your computer and use it in GitHub Desktop.
Check palindrome string using map
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