Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Palindrome challenge

const palindrome = str => {
  // turn the string to lowercase
  str = str.toLowerCase()
  // reverse input string and return the result of the
  // comparisong
  return str === str.split('').reverse().join('')
}
Source by www.sitepoint.com #
 
PREVIOUS NEXT
Tagged: #Palindrome #challenge
ADD COMMENT
Topic
Name
5+7 =