Hashlogics Interview Question

Q Write a javascript code for palindrome.