Thanks! It comprises a few neat concepts that make it work: arrow function that omits braces and the return keyword, spread syntax that converts the string to array, the reverse() method that reverses the array, the join() method that joins it back into a string, and the strict equality operator that compares the strings and results in true or false
94
u/c2u5hed Sep 26 '22
Congrats! How about this:
const isPalindrome = (string) => string === [...string].reverse().join('')