JavaScript/TypeScript Difference between for, while, forEach, for-in and for-of A lot of languages support several ways for loop logic. Typescript supports following ways for example.whileforfor in fo... 2020.10.21 JavaScript/TypeScript
JavaScript/TypeScript async/await with Promise in TypeScript Using promise makes the code much faster. This post explains the basic and advanced usage. 2020.10.14 JavaScript/TypeScript
JavaScript/TypeScript How to write unit tests for a singleton class Once a static field value changes in unit tests, the change applies to other tests because it's static. It's important to split it into two classes. One class has the main logic and the other stores the class to provide it as singleton. 2020.10.07 JavaScript/TypeScript
JavaScript/TypeScript Using spread operator for process.env I faced strange behavior when I used spread operator for process.env. In my project, our main source is Typescript but w... 2020.09.26 JavaScript/TypeScript
JavaScript/TypeScript How to write good unit tests? Unit Test makes your software better in terms of not only quality but also class structure because you need to separate ... 2020.09.23 JavaScript/TypeScript
JavaScript/TypeScript Dependency injection in Typescript. Constructor? Setter? Factory method? Decoupling class relationships is important for unit testing. Less cohesion makes writing unit tests easier. This post shows 3 ways to do it. Constructor injection, setter injection, and using the factory method to inject the desired instance. 2020.09.13 JavaScript/TypeScript