JAVASCRIPT · ОСНОВЫ · LESSON 04

Slice words.

Lines and + · about 12 minutes

Learning with progressRead the summary for free. To save the work, log in to the account.
STEP 1

Text is a line.

The line is quotation marks. You can also store a whole sentence in the variable.

const name = "Аня";

✦ name keeps the word Аня.

STEP 2

Put the pieces together.

The + sign connects the text. Put the space between the words inside the quotation marks.

const name = "Аня";
console.log("Привет, " + name);

✦ Hello, Аня.

IN-CLASS PRACTICE

Type the code yourself

Type an example manually. Check the names, brackets and signs.

const animal = "кот";
console.log("Мой " + animal);
Open the editor for class work
HOMEWORK

Solve it yourself

Save «Бим» to const dog. Output «Привет, Бим» by combining text and dog via +.

The answer is hidden. Use similar examples from the lesson notes.

Opening up your homework