Practice
JavaScriptData StructuresReactConcepts
Sign in
← Back to problems

Palindrome Check

Data Structures, Operators & Stringseasy

Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 128: Working With Strings - Part 1

Implement `isPalindrome(s)` returning whether `s` reads the same forwards and backwards, ignoring letter case.

Sample tests

Input: isPalindrome("racecar")
Output: true
Input: isPalindrome("hello")
Output: false

+ 1 hidden test run on Submit.

Hints

Common pitfalls
  • Forgetting to normalize case marks 'Abba' as not a palindrome.

Learning resources

  • MDN: String
Approach & explanation (try first)

Lowercasing then comparing against the reversed string gives a case-insensitive palindrome check.

Loading...
⌘/Ctrl + Enter

Run your code to see results.