Leetcode Check Palindrome Javascript Programming