How to Concatenate Strings in JavaScript (EASY Example!)

In JavaScript, you can’t divide, multiply, or subtract strings. But you can add two different strings together.

This is also more appropriately called concatenation which basically glues two ends of the string together.

How concatenation works on a string

Example 1: Combining strings by concatenation

console.log("Let's combine this sentence with " + "this even better sentence")

You can see that the (+) sign is right in the middle of these two strings.

Ultimately, the results of the code above are this.

Let's combine this sentense with this even better sentence

So what I’m getting from this is when you add (using the + sign on) 2 strings (designated with either a single, double, or backtick quotation surrounding it), you connect the 2 strings into one.

Leave a Comment