CKTIS / JavaScript
String.prototype.concat — joining strings
String.prototype.concat appends any number of arguments to a string, converting them to text. It returns a primitive string value and leaves the original string unchanged.
Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
Syntax
str.concat(...args)String.prototype.concat joins the receiver's string with zero or more arguments in the supplied order. It inserts no separators: spaces and punctuation must be supplied explicitly. The result is a primitive string value, not a String object.
Strings are immutable: the method does not change the original value. Assign the result to a variable to retain it. Calling it without arguments returns the receiver's text unchanged.
The receiver is converted to text first, followed by the arguments from left to right, using ToString. Arguments null and undefined produce "null" and "undefined", respectively; a symbol argument throws TypeError. Object conversion can execute custom code and throw an exception.
The method is generic: String.prototype.concat.call(42, "!") returns "42!". However, null and undefined as the receiver cause TypeError. This is an ECMAScript standard method, not a browser API.
Examples
const base = "Level";
const result = base.concat(" ", 3, "!");
console.log(result);
console.log(base);
console.log(base.concat() === base);Result
Level 3! Level true
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.