1+ /*Write a simple function(less than 160 characters) that returns a boolean indicating whether or not a string is a palindrome.*/
2+
3+ // Function Declaration
4+ function palindrome ( word ) {
5+ return [ ...word . toLowerCase ( ) ] . reverse ( ) . join ( '' ) == word . toLowerCase ( ) ?true :false
6+ }
7+ // Function Expression
8+
9+ const palindrome2 = ( word ) => [ ...word . toLowerCase ( ) ] . reverse ( ) . join ( "" ) == word . toLowerCase ( ) ?true :false
10+
11+ console . log ( palindrome ( "RaceCar" ) )
12+ console . log ( 'function palindrome(word){return [...word.toLowerCase()].reverse().join("") == word.toLowerCase() ? true : false}' . length )
13+
14+ console . log ( palindrome2 ( "LeVel" ) )
15+ console . log ( 'const palindrome2 = (word) => [...word.toLowerCase()].reverse().join("") == word.toLowerCase() ? true : false' . length )
16+
17+
18+ // Free Code Camp Version of Palindrome Solution
19+ function palindrome ( str ) { return [ ...str . toLowerCase ( ) . replace ( / [ _ * -\\ . , \\ \\ \\ ( \\ ) ] / g, \"\")].reverse().join(\"\") == str.toLowerCase().replace(/[_*-\\.,\\\\\\(\\) ]/g,\"\") ? true : false;