Interactive online courses HTML Academy
2026-03-09 12:55 Diff

Just 21 calories! Muffin is happy! Happy about your first program, too.

Second task: write a program for calculating the nutritional value of lunch and dinner. For lunch, Muffin loves his crunchy cat food, around 80 grams. For dinner, it’s the same fragrant, crunchy dry food, but a bit more, around 120 grams. That’s what a cat needs to get ready for nightly training. Yes, food diversity is not Muffin’s strongest suit.

You cannot write this program with a single line of code, you’ll need two. Don’t forget about the ; mark.

By the way, in JavaScript, you can use special commands for tips. They are called comments, and the code inside is never executed. As a rule, comments are used for notes to yourself, to other developers or yourself in the future. There two types of comments: one-line and multiline. Example of comments:

// This line will not be executed. One-line comment. /* None of these lines of code will be executed. Because it’s a multi-line comment. */