Eventually the maintenance developer realises that anger and tears aren't useful, and funnels that into documentation, cleanup and a hell of a lot of printf-debugging.
...and whiskey.
FWIW, it's possible to create messes in Backbone, JQuery, D3, React and plain javascript, if you try hard enough.