This is the second of a two part introduction on how to write testable Javascript UI code. The first article, Anti-Patterns and their fixes, uses a sample application to introduce several common, avoidable, and test-inhibiting anti-patterns. Why these common practices are anti-patterns and how to fix them are explained. This article continues by refactoring the original application to be easier to