- script.js
JavaScript
var onVacation = false;
if (true) {
console.log('You cannot start the project');
} else {
console.log('You can start the project');
}
Result
Goalscompleted
Let’s fix the program and experiment with the value of the variable onVacation.
- Replace the condition in
iftoonVacation. - Replace the value of the
onVacationvariable totrue. - And now to
2. The number is not equal to zero and casts totrue. - And to
0. The message should change. - Now to
''. - And, finally, remove the value from the variable, leaving just
var onVacation;.
Comments