loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
function palindrome(str) {
  // Good luck!
  lowerCaseStr = str.toLowerCase();
  lowerCaseStr = lowerCaseStr.replace(/\W/gi,'').replace(/_/g,'');
  var originalStr = lowerCaseStr.split('');
  var reverseStr = originalStr.reverse();

 console.log("Org Str" + originalStr);
 console.log("Rev Str" + reverseStr);
 
}
palindrome("123");
Native Browser JavaScript