-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblem63.js
More file actions
22 lines (18 loc) · 697 Bytes
/
problem63.js
File metadata and controls
22 lines (18 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* =================================================
------ Programme for Finding Palindrome --------
================================================= */
const findPalindrome = value => {
const valueIntoStr = value.toString();
const valueIntoReverseStr = valueIntoStr.split("").reverse().join("");
if(valueIntoStr === valueIntoReverseStr){
const message = `Your input text is "${value}" which is a "Palindrome".`;
console.log(message);
}
else{
const message = `Your input text is "${value}" which is "Not A Palindrome".`;
console.log(message);
}
}
findPalindrome("eye");
findPalindrome("madam");
findPalindrome("Shourav");