Check Palindrome In Leetcode Javascript