I would like to clarify something with my code. In this do while statement, the code works as intended when I remove the ‘cupsOfSugarNeeded = cupsOfSugarNeeded + cupsAdded’;…if I leave it, it runs continuously…why?
let cupsOfSugarNeeded = 10;
let cupsAdded = 0;
do {
cupsOfSugarNeeded = cupsOfSugarNeeded + cupsAdded;
cupsAdded++;
} while (cupsAdded < cupsOfSugarNeeded);
console.log(cupsOfSugarNeeded)