From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Array Object
The join() method is used to put all the elements of an array into a string.
The elements will be separated by a specified separator.
| arrayObject.join(separator) |
| Parameter | Description |
|---|---|
| separator | Optional. Specifies the separator to be used |
Note: Comma is the default separator for the join() method.
ExampleIn this example we will create an array, and then put all the elements in a string:
The output of the code above will be:
Try it yourself » |
JavaScript Array Object
From http://www.w3schools.com (Copyright Refsnes Data)