-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
TypeScript 5 Design Patterns and Best Practices - Second Edition
By :
When you declare interfaces and classes in TypeScript, the compiler utilizes this information for type checks and assertions. At runtime, the browser or server evaluates the code and manages these objects throughout the application’s life cycle. Sometimes, objects are created at the start of the application. For example, in the previous chapter, you saw the creation of an Express.js application object:
const app = express();
Other times, objects are created dynamically using an object descriptor. For instance, in Chapter 2, you learned how to create HTML span elements:
const span = document.createElement("span"); Both approaches address object creation, focusing on how to instantiate a type of object and store it. Reflecting on this reveals two distinct phases: