James Sherry PRO
Web Development Tutor and Co-Founder of { The Jump } Digital School
Seems so easy when I describe it!
Try to think it through and if you're lost then google and remember for next time!
Now in code add the actions as comments:
function checkPalindrome(possiblePalindrome){
// turn the string into an array
// then reverse it
// turn the array back into a string
// compare original to reverse
}
Now put the relevant code to achieve that underneath
function checkPalindrome(possiblePalindrome){
// turn the string into an array
let reverseString = possiblePalindrome.split("");
// then reverse it
reverseString.reverse();
// turn the array back into a string
reverseString = reverseString.join("");
// compare original to reverse
return possiblePalindrome === reverseString;
}
Look at the problem and split it up into:
By James Sherry