We’ve all been there: that bit of JavaScript functionality that started out as just a handful of lines grows to a dozen, then two dozen, then more. Along the way, a function picks up a few more arguments; a conditional picks up a few more conditions. And then one day, the bug report comes in: something’s broken, and it’s up to us to untangle the mess. As we ask our client-side code to take on more
![Writing Testable JavaScript](https://cdn-ak-scissors.b.st-hatena.com/image/square/371795274e4edaddb2d59ff3bfd933fe085b7b7a/height=288;version=1;width=512/https%3A%2F%2Fi0.wp.com%2Falistapart.com%2Fwp-content%2Fuploads%2F2013%2F05%2FALA375_javascripttesting_300_1.png%3Ffit%3D1200%252C430%26ssl%3D1)