Code Highlights logo

Learn

Getting Started with JavaScript

String Concatenation

In JavaScript, Operators aren’t just for numbers! We can use the + operator to concatenate two or more strings together. For example:

1console.log('I love ' + 'coding'); // Output: "I love coding"
2console.log('One' + ', ' + 'two' + ', ' + 'three!'); // Output: "One, two, three!"

This process of appending one string to another is called concatenation.

Just like with regular math, we can combine, or chain, our operations to get a final result:


Instructions

1.

Print the value of the concatenation of the string "Hello, " and "World!" to the console.

Sign up to start coding

Already have an account?

Sign In

Course content