Python Recursive Function For Palindrome In Js