DEV Community

Discussion on: 20 Killer JavaScript One-Liners Thatโ€™ll Save You Hours of Coding ๐Ÿคฏ๐Ÿ”ฅ

Collapse
 
jonrandy profile image
Jon Randy ๐ŸŽ–๏ธ • Edited

8) Convert an array to a string:

'' + array
Enter fullscreen mode Exit fullscreen mode

13) Check if a string is a palindrome:

string === [...string].reverse().join``
Enter fullscreen mode Exit fullscreen mode

Using split('') will not work with some strings - try "๐Ÿค”๐Ÿ˜ˆ".

Collapse
 
rammcodes profile image
Ram Maheshwari โ™พ๏ธ

Thanks for sharing ๐Ÿ™Œ