Update palindrome.md

This commit is contained in:
Angelos Chalaris
2018-10-15 08:06:52 +03:00
committed by GitHub
parent 8dcaaf4c63
commit d5b75cfc0f

View File

@ -2,8 +2,8 @@
Returns `true` if the given string is a palindrome, `false` otherwise.
Convert the string `String.toLowerCase()` and use `String.prototype.replace()` to remove non-alphanumeric characters from it.
Then, use the spread operator (`...`) to split the string into individual characters, `Array.prototype.reverse()`, `String.prototype.join('')` and compare it to the original, unreversed string, after converting it `String.toLowerCase()`.
Convert the string `String.prototype.toLowerCase()` and use `String.prototype.replace()` to remove non-alphanumeric characters from it.
Then, use the spread operator (`...`) to split the string into individual characters, `Array.prototype.reverse()`, `String.prototype.join('')` and compare it to the original, unreversed string, after converting it `String.prototype.toLowerCase()`.
```js
const palindrome = str => {