Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 1.89 KB

File metadata and controls

67 lines (54 loc) · 1.89 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
concat Method (String) (JavaScript) | Microsoft Docs
01/18/2017
windows-client-threshold
devlang-javascript
language-reference
concat
JavaScript
TypeScript
DHTML
concat method (String)
Concat method
5d28ebb2-d534-4179-9297-a4c821ee9f24
14
mikejo5000
mikejo
ghogen

concat Method (String) (JavaScript)

Returns a string that contains the concatenation of two or more strings.

Syntax

  
string1. concat([string2[, string3[, . . . [, stringN]]]])  

Parameters

string1
Required. The String object or string literal to which all other specified strings are concatenated.

string2,. . ., stringN
Optional. The strings to append to the end of string1.

Remarks

The result of the concat method is equivalent to: result = string1 + string2 + string3 + stringN. A change of value in either a source or result string does not affect the value in the other string. If any of the arguments are not strings, they are first converted to strings before being concatenated to string1.

Example

The following example illustrates the use of the concat method when used with a string:

var str1 = "ABCD"  
var str2 = "EFGH";  
var str3 = "1234";  
var str4 = "5678";  
document.write(str1.concat(str2, str3, str4));  
  
// Output: "ABCDEFGH12345678"  
  

Requirements

[!INCLUDEjsv3]

Applies To: String Object

See Also

Addition Operator (+)