- script.js
JavaScript
var foodInGrams = 60;
var dayLimit = 80;
if (foodInGrams < dayLimit) {
console.log('You can eat more!');
}
Result
Goalscompleted
Add the else branch to the program:
- After the closing brace of the
ifblock, addelse { }. - Inside the
elseblock, add theconsole.log('Not a piece more!');command. - On the first line, replace the value of
foodInGramswithmuffin.ask('How many grams of food have you eaten today? Just be honest?').
Comments