The commonest javascript bug

Posted by & filed under A tech a day.

Every couple of weeks somebody will come running to me: “Swizec, Swizec, I did everything right, but this javascript isn’t doing what it’s supposed to! Whatever I click only the last item works. Halp!” Every time it’s the same bug – people just don’t understand how loops and closures play together in javascript. Invariably they loop… Read more »