Remember the time before arrow functions, when var was everywhere and JavaScript code looked noticeably different from what we write today? Recently, I stumbled upon some old code in a custom CMS interface that looked genuinely ancient, and it made me think of all those obscure JavaScript patterns that used to be extremely common.
The former self
Losing the execution context was a very common problem back then. JavaScript's runtime binding of this has always been a source of confusion. Instead of explicitly binding callbacks, developers often captured the surrounding this in a variable - usually called self or that.
var self = this
button.addEventListener('click', function () {







