Create palindrome

This commit is contained in:
Manjunath s 2023-11-13 21:48:57 +05:30 committed by GitHub
parent 76617fa83a
commit b9ff1b37f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,11 @@
function checkPalindrome(str){
if(str.split('').reverse().join('') == str)
return true;
else
return false;
}
if (checkPalindrome("madam") !== true)
console.log("Test fails: Expected true for input str = 'madam'");
else
console.log("Sample test case for input str = 'madam' passed!");