Skip to content

JS String Concatenation

Syntax

String concatenation in JavaScript combines multiple strings using the + or += operators.

let combinedString = string1 + string2; // Using the + operator
string1 += string2;

Example

let firstName = "John";
let lastName = "Doe";
let fullName = firstName + " " + lastName; // Concatenation with +
console.log("Full Name: " + fullName);
// Appending to a string
let greeting = "Hello";
greeting += ", World!";