| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
join Method (Array) (JavaScript) | Microsoft Docs |
01/18/2017 |
windows-client-threshold |
|
language-reference |
|
|
|
20f8fde1-014b-488e-9008-464a86e6b21f |
16 |
mikejo5000 |
mikejo |
ghogen |
Adds all the elements of an array separated by the specified separator string.
arrayObj.join([separator])
arrayObj
Required. An Array object.
separator
Optional. A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
If any element of the array is undefined or null, it is treated as an empty string.
The following example illustrates the use of the join method.
var a, b;
a = new Array(0,1,2,3,4);
b = a.join("-");
document.write(b);
// Output:
// 0-1-2-3-4
[!INCLUDEjsv2]