JAVASCRIPT · ОСНОВЫ · LESSON 19

Convenient words

toUpperCase and length · about 12 minutes

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

Count the letters.

The string has length, the number of its characters.

const word = "кот";
console.log(word.length);

✦ That's 3.

STEP 2

Make big letters.

The toUpperCase method returns a new string with capital letters.

const word = "кот";
console.log(word.toUpperCase());

✦ A cat will appear.

IN-CLASS PRACTICE

Type the code yourself

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

const word = "мир";
console.log(word.toUpperCase());
Open the editor for class work
HOMEWORK

Solve it yourself

Save the word «дом» in const word. Indicate its length through length.

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

Opening up your homework