Skip to content

concat ​

The concat() method combines the text of multiple strings and returns a new string.

Interactive example ​

Syntax ​

Classic signature ​

typescript
function concat(
	input: string,
	...textsRest: string[]
): string

Curried signature ​

typescript
function concat<
	GenericInput extends string
>(
	text: string
): (input: GenericInput) => string

Parameters ​

  • input: The base string.
  • textsRest: One or more strings to concatenate with input.

Return value ​

A new string containing the combined text of the provided strings.

See also ​

  • repeat - Repeats a string a given number of times
  • padStart - Pads the string at the start
  • padEnd - Pads the string at the end

Sources ​

Released under the MIT license.