Logo

Programming-Idioms

History of Idiom 53 > diff from v38 to v39

Edit summary for version 39 by programming-idioms.org:
[JS] ", " is not the default

Version 38

2016-04-12, 20:21:13

Version 39

2016-05-03, 21:22:26

Idiom #53 Join a list of strings

Concatenate elements of string list x joined by the separator ", " to create a single string y.

Idiom #53 Join a list of strings

Concatenate elements of string list x joined by the separator ", " to create a single string y.

Code
y = x.join(", ");
Code
y = x.join(", ");
Comments bubble
In this case, you could leave out the ", " string in join, as that's the default. I've included it to show that you can join with other delimiters, too.