Reflow, Repaint, and Layout Thrashing
The two expensive rendering steps triggered by DOM/style changes, and the anti-pattern of alternating reads and writes that forces the browser to recalculate layout repeatedly.
Reflow (also called layout) and repaint are two distinct, potentially expensive steps the browser performs after a DOM or style change, and understanding when each is triggered — and how to avoid triggering them excessively — is central to writing performant DOM-manipulation code, especially for animations or frequently-updating UI.
Layout thrashing is like repeatedly asking a mover 'how much does the truck weigh right now?' immediately after loading each individual box, forcing them to stop and put the truck on a scale after every single box, instead of letting them load the entire truck first and weigh it just once at the very end.