String Concatenation
Joining strings together.
Examples
Using + Operator
Joining strings with the plus operator.
let text1 = "Hello";
let text2 = "World";
let text3 = text1 + " " + text2;
console.log(text3);Using concat()
Using the concat() method.
let text1 = "Hello";
let text2 = "World";
let text3 = text1.concat(" ", text2);
console.log(text3);Test Your Knowledge
JavaScript Quiz
No quiz available for this topic yet.