Skip to main content
🌱 Coding Level 1: First Steps 🌱

Add Them Up βž•

Computers are great at math. You can add two numbers (or two boxes) with the + sign:

let a = 2;
let b = 3;
a + b;   // 5

Below you have a box of cookies and a box of candies. Right now the function only hands back the cookies. Add the candies too!

Your task

Make snackTotal hand back cookies + candies (that's 2 + 3 = 5).

⚑ 20 XP

🧱 Code blocks

Drag a block into the editor, or tap it to drop it in where your cursor is. Add them in order to build your answer.

solution.jsRuns in your browser
Loading editor…
Tests1 to pass
snackTotal() is 5

Run your code to check these.