By: Dusty Arlia
Published on Monday, March 25, 2013, 11:30 AM
Last Updated on Saturday, July 11, 2015 at 8:43 PM
Total Updates: 3

The JavaScript join() method creates a string from the values in an array. Here is an example:

var my_array = [1,"hello",3];
my_array.join(); // returns the string "1,hello,3"

By default, a comma is inserted between each value. Optionally you can pass a separator string:

my_array.join(", "); // returns the string "1, hello, 3"