Dependency Injection in JavaScript: Write Testable Code Easily
I struggled with two aspects of software development as a junior engineer: structuring large codebases and writing testable code. Test-driven development is such a common technique that is often taken for granted, but it's not always clear how code can be made fully testable. I remember reading examples where an author would cleanly unit test a function, and in principle, it made sense. But real code doesn't look like those examples.