Separating mutation from calculation
Isolate where mutations happen
Make your functions pure and only plug in things that change at the end.
Shows teaser function (cuts down a text by x length). In one example the teaser manipulates the dom element directly in the improved example it just receives text.
Separates mutation from calculation.
Again, very hard to test the function if it mutates the DOM. We have to mock out a DOM implementation.