Leetcode Check Palindrome Javascript Program