javascript, palindrome checker