Fix error in ruby function.
Add javascript function for palindrome problem.