LESSON 04 OF 50

Calculate with numbers

Build a numeric result with the multiplication operator.

Official sourceECMAScript — multiplicative operatorsReviewed: 2026-08-26
STEP 1 · LEARN

How it works

The * operator converts operands according to numeric rules and produces their product. Storing the expression in a variable makes the result reusable.

Correct example
const total = 6 * 7;
console.log(total);

The 6 * 7 expression is evaluated before 42 is assigned to the constant.

Common mistake
const total = '6 * 7';

Inside quotes this is a string, not an arithmetic expression.

STEP 2 · APPLY

Your exercise

Declare total as the product of 6 and 7, then print total.

STEP 3 · RUN

Write and run the code

script.jsJAVASCRIPT
Isolated consoleisolated
Preparing the runtime…
Run the code to see the result.
The draft stays only in this browser.Isolated QuickJS · no DOM, session or network
STEP 4 · CHECK

What needs to pass

0%not checked
  • total is declared with const.
  • The expression uses the * operator.
  • The output is 42.
Explain the solution logic

The operator produces the numeric value, and const stores the verifiable result.