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.