Skip to content
Foxipa
Code Completion 5 Challenges

Complete the number calculations

Complete each JavaScript snippet by supplying the missing numeric expression or type-aware operation.

Beginner ~6 min read

Challenge 1

Complete the expression that gives the remainder when 17 is divided by 5.

javascript Your answer
const remainder = 17  5;
console.log(remainder);

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the expression that calculates 2 to the power of 10.

javascript Your answer
const result = 2  10;

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the expression that counts only complete groups of 5 in 17 items.

javascript Your answer
const groups = Math.floor(17 );

Press Ctrl⌘Enter to check your answer

Challenge 4

Add the BigInt suffix to make this literal a BigInt.

javascript Your answer
const views = 9007199254740993;

Press Ctrl⌘Enter to check your answer

Challenge 5

Complete the BigInt addition using matching numeric types.

javascript Your answer
const total = 10n  20n;

Press Ctrl⌘Enter to check your answer