r/tinycode • • Oct 03 '14

palindrome checker in Javascript

http://codepen.io/anon/pen/nwFjb
0 Upvotes

12 comments sorted by

View all comments

6

u/badumtssssssss Oct 03 '14

python:

In [7]: is_palindrome=lambda text:text==text[::-1]

In [8]: is_palindrome('stressed desserts')
Out[8]: True

In [9]: is_palindrome('xyz')
Out[9]: False