Fix typos and missing highlighting

This commit is contained in:
Angelos Chalaris
2017-12-12 16:25:13 +02:00
parent b7b9e9476e
commit 8ea78970b2
2 changed files with 4 additions and 4 deletions

View File

@ -3,6 +3,6 @@
Convert string `toLowerCase()` and use `replace()` to remove non-alphanumeric characters from it.
Then, `split('')` into individual characters, `reverse()`, `join('')` and compare to the original, unreversed string, after converting it `tolowerCase()`.
```
palindrome = str => (str.toLowerCase().replace(/[\W_]/g,'').split('').reverse().join('')==str.toLowerCase().replace(/[\W_]/g,''));
```js
const palindrome = str => (str.toLowerCase().replace(/[\W_]/g,'').split('').reverse().join('')==str.toLowerCase().replace(/[\W_]/g,''));
```