Loading…
Everything will be ready in few seconds
- Theory
- Theory
- Comments
Career start
Congratulations! You are now a qualified programmer on Muffin’s team. How does a cat choose a human for itself? Nobody knows. But once it has chosen you, you need to start showing your best.
Know nothing about programming? No worries, we’ll teach you!
So what will you have to do? Write programs for your whiskered boss in JavaScript. First, you will write simple programs for the console, but will then switch to animating website interfaces.
Let’s take a look at your workplace:
- On the left is the editor, that’s where you will write code.
- The console is on the right, that’s where your programs will output the results of their work.
- By default, programs are run automatically, but you can change it in settings.
- The list of tasks for the day is in the lower right corner. The tasks that you completed correctly are highlighted.
Everything is set up, including a cup of tea. Let’s go!
First task: write a program for calculating the nutritional value of 50 grams of milk (Muffin’s morning snack).
Let’s do it together. Each program is a set of commands. In JavaScript, commands are separated with a semicolon, ;
. To complete the task, enter one command in the console:
50 * (42 / 100);
That’s our program, just one command. But it works!
- script.js
Thanks! We’ll fix everything at once!
The code has changed, click “Run” or turn autorun on.
Comments