Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Multiline Strings. Concatenating | JavaScript syntax
Introduction to JavaScript (staging)
course content

Зміст курсу

Introduction to JavaScript (staging)

Introduction to JavaScript (staging)

1. Introduction
2. JavaScript syntax
3. Data Types and Variables

Multiline Strings. Concatenating

Concatenating Multiple Lines

We can implement a multi-line string by concatenation of every line of the multi-line string to the variable. Below we have a code example for it:

1234
let myStr = "This is my" + " multiline String " + " which is amazing"; console.log(myStr);
copy

Завдання

Take two variables named firstPart and secondPart and assign the values of "This is a" and " JavaScript book." respectively. The task is to concatenate the above variables using the + operator and store the concatenated string in a variable named book, and show value on the console.

Завдання

Take two variables named firstPart and secondPart and assign the values of "This is a" and " JavaScript book." respectively. The task is to concatenate the above variables using the + operator and store the concatenated string in a variable named book, and show value on the console.

Summary:

  • A string which comes on more than one line in the code is called Multiline String.
  • Template literals are used to implement multi-line string by using backticks.
  • Backslashes are used to implement multiline string.
  • Concatenation is used to implement multiline string.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

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

Секція 2. Розділ 13
toggle bottom row

Multiline Strings. Concatenating

Concatenating Multiple Lines

We can implement a multi-line string by concatenation of every line of the multi-line string to the variable. Below we have a code example for it:

1234
let myStr = "This is my" + " multiline String " + " which is amazing"; console.log(myStr);
copy

Завдання

Take two variables named firstPart and secondPart and assign the values of "This is a" and " JavaScript book." respectively. The task is to concatenate the above variables using the + operator and store the concatenated string in a variable named book, and show value on the console.

Завдання

Take two variables named firstPart and secondPart and assign the values of "This is a" and " JavaScript book." respectively. The task is to concatenate the above variables using the + operator and store the concatenated string in a variable named book, and show value on the console.

Summary:

  • A string which comes on more than one line in the code is called Multiline String.
  • Template literals are used to implement multi-line string by using backticks.
  • Backslashes are used to implement multiline string.
  • Concatenation is used to implement multiline string.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

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

Секція 2. Розділ 13
toggle bottom row

Multiline Strings. Concatenating

Concatenating Multiple Lines

We can implement a multi-line string by concatenation of every line of the multi-line string to the variable. Below we have a code example for it:

1234
let myStr = "This is my" + " multiline String " + " which is amazing"; console.log(myStr);
copy

Завдання

Take two variables named firstPart and secondPart and assign the values of "This is a" and " JavaScript book." respectively. The task is to concatenate the above variables using the + operator and store the concatenated string in a variable named book, and show value on the console.

Завдання

Take two variables named firstPart and secondPart and assign the values of "This is a" and " JavaScript book." respectively. The task is to concatenate the above variables using the + operator and store the concatenated string in a variable named book, and show value on the console.

Summary:

  • A string which comes on more than one line in the code is called Multiline String.
  • Template literals are used to implement multi-line string by using backticks.
  • Backslashes are used to implement multiline string.
  • Concatenation is used to implement multiline string.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

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

Concatenating Multiple Lines

We can implement a multi-line string by concatenation of every line of the multi-line string to the variable. Below we have a code example for it:

1234
let myStr = "This is my" + " multiline String " + " which is amazing"; console.log(myStr);
copy

Завдання

Take two variables named firstPart and secondPart and assign the values of "This is a" and " JavaScript book." respectively. The task is to concatenate the above variables using the + operator and store the concatenated string in a variable named book, and show value on the console.

Summary:

  • A string which comes on more than one line in the code is called Multiline String.
  • Template literals are used to implement multi-line string by using backticks.
  • Backslashes are used to implement multiline string.
  • Concatenation is used to implement multiline string.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 2. Розділ 13
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt