Session
8 new from Text Editing Beginner. About 2 min.
New
Cut line
⌃Ctrl+X
This log belongs in another function. Take the whole line out so you can paste it there.
shop.js — shopgoal
shop.jscheckout.jscolors.js
1function subtotal(items) {
2 let sum = 0;
3 console.log(items);
4 for (const item of items) {
5 sum += item.price * item.qty;
6 }
7 return sum;
Line 3, Column 6Spaces: 2 · JavaScript
or press Enter