- script.js
JavaScript
var enoughDevelopers = false;
var techAvailable = false;
var onVacation = false;
var onSickLeave = false;
if (enoughDevelopers && techAvailable) {
console.log('You can start the project');
}
Result
Goalscompleted
Let’s complete the program and check its behavior.
- Add
!onVacation
condition at the end of the check using “logical AND”. - And after it, also using “logical AND”
!onSickLeave
condition. - Now add the
else
fork and log the'You cannot start the project'
message in it. - Correct the values of the variables so that the condition is fulfilled.
- Then indicate that someone from the developers is on vacation and make sure that the project cannot be started.
Comments