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

What if the decision does not depend on one, but on two or more conditions? You can use one if, and then, if the condition is fulfilled, execute one more condition inside the nested if:

if (condition1) { if (condition2) { actions; } }

Then within the second check you can perform the third one and so on indefinitely.

Let’s continue writing the program “Can I start the project”, which became really complicated. Now you can proceed to the project if two conditions are met:

  1. there are enough developers: variable enoughDevelopers;
  2. and the developers have the knowledge of the required technologies: variable techAvailable.

If there are enough developers and if the required technology is mastered, we log the message “You can start the project”, otherwise the message remains unchanged: “You cannot start the project”.