Help with do while statement

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)

That’s because adding that line creates an infinite loop, where, since cupsOfSugarNeeded grows faster than cupsAdded, the condition cupsAdded < cuprsOfSugarNeeded is always true, resulting in the loop running continuously.