A backend team asks why TypeScript interfaces are used instead of plain JavaScript objects in API contracts. What is the best explanation?
-
A
Interfaces enforce runtime validation automatically
-
B
Interfaces provide compile-time shape guarantees and serve as living documentation for API contracts
-
C
Interfaces compile to smaller JavaScript bundles
-
D
Interfaces prevent all runtime errors in production