Interactive online courses HTML Academy
2026-03-09 10:54 Diff

Excellent! We found an error. As Descartes said: “If the bug is reproduced, then it exists”.

Where is the error? Now the program has two separate checks. And these checks can work simultaneously. When this happens, two messages appear.

To correct the error, let’s first introduce new checks with negation:

  • no developers are on vacation;
  • no developers are out sick.

In these conditions, the keyword is “no”, which means that they must be executed in cases where the value of the variable is  false and not executed if the value is true.

To create checks with negation, unary (single) logical operator ! is used. Example:

var condition = false; if (!condition) { // code will be executed }

Practice using the negation in the program “Can I start the project?”.