- script.js
JavaScript
// Muffin had a bit of a bigger
// breakfast than usual today
var milkInGrams = 60;
var breakfastCalories = milkInGrams * (42 / 100);
console.log(breakfastCalories);
var dryFeedInGrams = (500 - breakfastCalories) / 4;
console.log(dryFeedInGrams);
Result
Goalscompleted
Make your console output more informative by merging variables with tips. To do that, replace the variables inside console.log() with expressions:
- Inside the first
console.logcommand, replacebreakfastCalorieswith'Boss, the breakfast had ' + breakfastCalories + ' calories.' - Inside the second
console.logcommand, replacedryFeedInGramswith'You can eat ' + dryFeedInGrams + ' more grams of dry food.'
Comments