Skip to content

Commit

Permalink
Problem saadfareed#9 Javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
RazaKhan9639 committed Oct 9, 2022
1 parent 5219865 commit 248f9f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions JS/IsPalindrom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//Name: Raza Mohayyuddin

//Username: RazaKhan9639

//Approach:First we use toString method to convert integer to string Then we Convert the string in array by split("") method then reverse array Then join() to merge array. Than compare with original string and return.

var isPalindrome = function (x) {
return x == x.toString().split("").reverse().join("");
};

0 comments on commit 248f9f8

Please sign in to comment.