r/javascript • • Mar 18 '19

What's your favorite, most useful javascript one-liner?

385 Upvotes

422 comments sorted by

View all comments

1

u/tobegiannis Mar 19 '19

Array.prototype.join is a simple way to handle none, one or many with strings.

const csv = values.join(“,”)