Palindorome in javascript