← Back to challenges

Recursion: Palindrome Phrase

JavaScriptHardrecursionstringsvalidationlogic

Instructions

A palindrome is a series of letters or numbers that reads equivocally backwards. Write a recursive function that determines whether a given string is a palindrome or not.

Examples

isPalindrome("Go hang a salami, I'm a lasagna hog!") ➞ true

isPalindrome("This phrase, surely, is not a palindrome!") ➞ false

isPalindrome("Eva, can I see bees in a cave?") ➞ true

Notes

  • Symbols and special characters should be ignored.
  • You are expected to solve this challenge via recursion.
  • A collection of challenges in recursion can be found via this link.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.