Some of you probably already knew this, but I only recently discovered this (accidentally) while building a wrapper around Postgresql queries in Node, and my mind is blown, to be honest.

Calling toString() on an array will automatically return the values within as a comma-separated string. Best of all, unlike other implementations, there is no hanging comma either.

#javascript #programming

How To Easily Convert A Javascript Array Into a Comma Separated String
1.75 GEEK