JavaScript Basics: String Concatenation with Variables and Interpolation

Max N
2 min readDec 11, 2019

In JavaScript, we can assign strings to a variable and use concatenation to combine the variable to another string.

To concatenate a string, you add a plus sign+ between the strings or string variables you want to connect.

let myPet = 'seahorse';
console.log('My favorite animal is the ' + myPet + '.');
// My…

--

--

Max N

A writer that writes about JavaScript and Python to beginners. If you find my articles helpful, feel free to follow.