JavaScript String concat()

Last Updated On Friday 17th Jun 2022

JavaScript String concat()

In this tutorial, we will learn about the JavaScript String concat() method with the help of examples.

The concat() method concatenates given arguments to the given string.

Syntax

	str.concat(str1, ..., strN)
	
  • Here str is a String.

Parameters

str & strN – One or more strings to concatenate to str.

Return Value

Returns a new string contains combined text of the strings

Example: Using concat() method

	"".concat(false);

"".concat({});

"".concat(null);

"".concat(4, 4);

const hello = "Hello";
const world = "World";

hello.concat(", ", world, "!"));
	

Output

	false
[object Object]
null
44
Hello, World!
	

Note: The assignment operators like + and += are strongly recommended over the concat() method.

Browser Support

concat() is an ECMAScript1. It is fully supported in all browsers.

Chrome IE Edge Firefox Safari Opera
Yes Yes Yes Yes Yes Yes
javascript string concat
javascript string concat method
string concat javascript
javascript concat string
concat string javascript
concat javascript string
js string concat
js concat string
string.concat javascript
concat in javascript