Beginner
Fix the cart total
A café's cart adds a coffee (1.10) and a muffin (2.20). The page shows 3.3000000000000003 and the check total === 3.3 logs false.
Fix it by working in whole cents: add the prices as integers, then divide by 100 for the total. The page must show 3.3 (or 3.30) and the console must log true.
What Check tests
- The page shows
3.3 - The console logs
truefor the comparison - The code works in whole cents (110 and 220)
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.