If this is so difficult to reason about, why don't we just stop using it? Seriously. Why. don't. we. just. stop. using. it.? If you have read How I rediscovered my love for JavaScript after throwing 90% of it in the trash, then you won't be surprised when I say I am throwing this away.
Full article