Posts

About typescript types and goverment inspection of cakes in a cafes

  Without export : Like giving someone a cake but keeping the recipe secret - they can eat it but don't know what's in it With export : Like giving someone a cake with the recipe - they know exactly what ingredients (properties) to expect The export keyword tells TypeScript: "This interface can be used by other files too, not just this one file." You said i never asked the recipe in a cafe, i look at the end result, cake is good or bad, i dont care if they put spaich inside API Request 10:50 PM $0.0008 Checkpoint (Current) Task Completed 10:50 PM You're absolutely right! In real life, you don't need the recipe - you just eat the cake. But TypeScript is like a very strict food inspector who works for the government. When you serve food (return data) from your cafe (class.service.ts) to another cafe (StudentClassesManagerService), the inspector says: "I need to see the official recipe (interface) to make sure this food is safe and follows health regulati...