410 B
410 B
Check For Palindrome
Steps :
- First Converted to form in which no non-alphanumeric character is present i.e. string which is to be compared
- Then Converted to palindrome form in which characters will be reversed and will be compared to non-alphanumeric string
palindrome = str => (str.toLowerCase().replace(/[\W_]/g,'').split('').reverse().join('')==str.toLowerCase().replace(/[\W_]/g,''));