Skip to content

Commit bd99545

Browse files
problem-22 solved
1 parent a90813c commit bd99545

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@
2323
| Problem - 19 | Get Url Parameters |
2424
| Problem - 20 | Detect device types |
2525
| Problem - 21 | Return the total of all the records' scores - GameOf11 |
26+
| Problem - 22 | Check the number is Palindrome or not |
2627
<!-- | Problem - 22 | | -->

Diff for: problem-22.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// check the number is Palindrome or not
2+
function isPalindrome(num) {
3+
const temp = num.toString().split('').reverse().join('') * 1;
4+
return (result = num === parseInt(temp) ? true : false);
5+
}
6+
7+
console.log(isPalindrome(121));
8+
console.log(isPalindrome(320));

0 commit comments

Comments
 (0)