update description, run tests

This commit is contained in:
Stefan Feješ
2018-04-26 19:22:21 +02:00
parent d050f16991
commit 36a8fa2176
3 changed files with 37 additions and 16 deletions

View File

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