Skip to content

Latest commit

 

History

History
66 lines (54 loc) · 1.49 KB

File metadata and controls

66 lines (54 loc) · 1.49 KB
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
devlang-javascript
language-reference
join
JavaScript
TypeScript
DHTML
Join method
concatenating strings, join method
arrays [Visual Studio], joining
20f8fde1-014b-488e-9008-464a86e6b21f
16
mikejo5000
mikejo
ghogen

join Method (Array) (JavaScript)

Adds all the elements of an array separated by the specified separator string.

Syntax

  
arrayObj.join([separator])   

Parameters

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.

Remarks

If any element of the array is undefined or null, it is treated as an empty string.

Example

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  
  

Requirements

[!INCLUDEjsv2]

See Also

String Object