What’s wrong with this JavaScript?
var numPackages == 0;
if (coffeeProducts <= 12) {
numPackages == 1;
} else if (coffeeProducts % 12 == 0) {
numPackages == coffeeProducts/12;
} else {
numPackages == (coffeeProducts/12) + 1;
}
Basically, it needs to calculate the number of boxes/packages necessary to ship an amount of items (12 per box). Is there a better way to do this, perhaps using round()?
All the others explained your mistake with the comparing operator
==and the assigning operator=.The shortest way to solve it would be