Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
String Concatenation | Basic Operations
Introduction to JavaScript

String ConcatenationString Concatenation

Let's explore some operations that you can perform with strings in JavaScript.

Concatenation

Concatenation is the process of combining two strings. This operation is achieved using the + operator:

You can see that concatenation creates a new string by combining two words.

Note

String concatenation does not automatically add spaces. You need to manually include spaces like string1 + " " + string2.

Let's create a nicely formatted string through concatenation:

Concatenation with Assignment

The += operator allows you to add text to a string-type variable:

What will be the output?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 3. Розділ 9
course content

Зміст курсу

Introduction to JavaScript

String ConcatenationString Concatenation

Let's explore some operations that you can perform with strings in JavaScript.

Concatenation

Concatenation is the process of combining two strings. This operation is achieved using the + operator:

You can see that concatenation creates a new string by combining two words.

Note

String concatenation does not automatically add spaces. You need to manually include spaces like string1 + " " + string2.

Let's create a nicely formatted string through concatenation:

Concatenation with Assignment

The += operator allows you to add text to a string-type variable:

What will be the output?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 3. Розділ 9
some-alt