- script.js
JavaScript
var foodInGrams = 60;
var dayLimit = 80;
if (foodInGrams < dayLimit) {
console.log('You can eat more!');
}
Result
Goalscompleted
Add the else fork to the program:
- After the curly brackets,
if, addelse { }. - Within the curly brackets
elseadd 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