DrFirst interview question

Basic Javascript sorting question , palindrome