← Back to challenges

Recursion: Palindrome Word

JavaScriptHardrecursionstringsvalidation

Instructions

Create a recursive function that determines whether a word is a palindrome or not.

Examples

isPalindrome("madam") ➞ true

isPalindrome("adieu") ➞ false

isPalindrome("rotor") ➞ true

Notes

  • All inputs are in lowercase.
  • You are expected to solve this challenge via recursion.
  • If you think recursion is fun, a collection of those challenges can be found in here.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.