JAVASCRIPT · ОСНОВЫ · LESSON 06

Truth or falsehood

Comparison and boolean · about 12 minutes

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

The test has two answers.

The comparison returns true if the answer is «да», and false if «нет».

console.log(8 > 5);

✦ Answer true.

STEP 2

Comparison to equality

Three signs == ask if the values and their types are the same.

console.log(3 === 4);

✦ Answer false.

IN-CLASS PRACTICE

Type the code yourself

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

const enough = 8 > 5;
console.log(enough);
Open the editor for class work
HOMEWORK

Solve it yourself

Save in const equal the test result 4 = = = = 6 and output equal.

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

Opening up your homework