[javascript] How to write palindrome in JavaScript