0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>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:</p>
1
<p>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:</p>
2
if (condition1) { if (condition2) { actions; } }<p>Then within the second check you can perform the third one and so on indefinitely.</p>
2
if (condition1) { if (condition2) { actions; } }<p>Then within the second check you can perform the third one and so on indefinitely.</p>
3
<p>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:</p>
3
<p>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:</p>
4
<ol><li>there are enough developers: variable enoughDevelopers;</li>
4
<ol><li>there are enough developers: variable enoughDevelopers;</li>
5
<li>and the developers have the knowledge of the required technologies: variable techAvailable.</li>
5
<li>and the developers have the knowledge of the required technologies: variable techAvailable.</li>
6
</ol><p>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”.</p>
6
</ol><p>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”.</p>