0 day streak
javascript / beginner
Snippet

String Concatenation with the Plus Operator

In JavaScript, you can join two or more strings together using the plus (+) operator. This process is known as concatenation.

snippet.js
javascript
1
2
3
4
const greeting = "Hello";
const target = "Node.js";
const message = greeting + " " + target + "!";
console.log(message);
nodejs
Breakdown
1
const message = greeting + " " + target + "!";
Combines the variables and literal strings into a single string.