← Back to challenges

Is the String a Palindrome?

JavaScriptHardstringsvalidationloopsinterview

Instructions

A palindrome is a word that is identical forward and backwards.

  • mom
  • racecar
  • kayak

Given a word, create a function that checks whether it is a palindrome.

Examples

checkPalindrome("mom") ➞ true

checkPalindrome("scary") ➞ false

checkPalindrome("reviver") ➞ true

checkPalindrome("stressed") ➞ false

Notes

All test input is lower cased.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Additive Inverse