Remove live code & console.log, leave examples as comments (ProjectEuler, Recursive).

This commit is contained in:
Eric Lavault
2021-10-10 18:18:25 +02:00
parent 9212e6d684
commit 5f45b540b9
17 changed files with 48 additions and 98 deletions

View File

@ -1,6 +1,6 @@
// Check whether the given string is Palindrome or not
const Palindrome = (str) => {
export const Palindrome = (str) => {
if (typeof str !== 'string') {
str = str.toString()
}
@ -18,13 +18,4 @@ const Palindrome = (str) => {
} else {
return Palindrome(str.slice(1, str.length - 1))
}
};
// testing
(() => {
console.log('Palindrome: String: a = ', Palindrome('a'))
console.log('Palindrome: String: abba = ', Palindrome('abba'))
console.log('Palindrome: String: ababa = ', Palindrome('ababa'))
console.log('Not Palindrome: String: abbxa = ', Palindrome('abbxa'))
console.log('Not Palindrome: String: abxa = ', Palindrome('abxa'))
})()
}