Variables with let and const

Each pack holds four cards. Print the number of cards after packing the input number of packs.

Examples

Example 1

Input
3
Expected output
12

Example 2

Input
0
Expected output
0

Starting point

const packs = 3;
const cardsPerPack = 4;
// Multiply the values and print the total.

Hints and solution

Hint 1

Find the operator for multiplying two numbers.

Reveal worked answer

Multiply packs * cardsPerPack and print the result. This works for zero packs because zero times four is zero.

const packs = 3;
const cardsPerPack = 4;
console.log(packs * cardsPerPack);
Back to the lesson