- script.js
JavaScript
var red = 1;
var yellow = 2;
var green = 3;
if (red > yellow) {
console.log('Red markers are in the minority. The forecast is moderately positive!');
} else {
console.log('Wrong! The forecast is unacceptable!');
}
if (green < yellow) {
console.log('Green markers prevail over the yellow ones. The forecast is positive!');
} else {
console.log('Wrong! The forecast is unacceptable!');
}
Result
Goalscompleted
Let’s correct the forecasting program.
- Replace the comparison operator with
<
in the firstif
. - Replace the comparison operator with
>
in the secondif
.
Comments