Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Working with Numbers | Section
JavaScript Fundamentals

Imagine a situation where a store launches a promotion: when purchasing 5 items at $17 each, the 6th item is free.

A total of 27 people participated in the promotion.

Calculate the total revenue from this promotion using multiplication.

This task (and the next ones) use a small helper function to check your answer automatically. You don't need to understand function or return yet — you will learn both later in the course. Focus only on this line:

return ___;

Replace ___ with your calculation using multiplication. For example:

return 2 * 10;

Just write your final answer as a math expression after return. The same pattern will be used in the next challenges, so no need to worry.

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 5
single

single

Challenge: Working with Numbers

Swipe to show menu

Task

Swipe to start coding

Imagine a situation where a store launches a promotion: when purchasing 5 items at $17 each, the 6th item is free.

A total of 27 people participated in the promotion.

Calculate the total revenue from this promotion using multiplication.

This task (and the next ones) use a small helper function to check your answer automatically. You don't need to understand function or return yet — you will learn both later in the course. Focus only on this line:

return ___;

Replace ___ with your calculation using multiplication. For example:

return 2 * 10;

Just write your final answer as a math expression after return. The same pattern will be used in the next challenges, so no need to worry.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 5
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt