Hashlogics interview question

Q Write a javascript code for palindrome.