✨ Add "is-palindrome" challenge

This commit is contained in:
Divlo committed 2020-07-05 19:01:27 +02:00
1 parent 957e13bc5e
commit 7c9c59e5b1
5 files changed
+45

No files matched your search

Whitespace-only changes.
@@ -0,0 +1,4 @@
# typescript-palindrome - is-palindrome
Programming language : TypeScript
Created by [@Divlo](https://github.com/Divlo) at 5 July 2020.
@@ -0,0 +1,6 @@
function solution (string: string) {
const formattedString = string.replace(/ /g,'').toLowerCase()
return formattedString === formattedString.split("").reverse().join('')
}
export default solution