Type Inference
type-inference-finds-error.ts
Type inference can also work through context, which is handy with callbacks. Consider the following:
In this example the context is not obvious since the interfaces have beendefined explicitly. In a browser environment with a real object, thiswould be a handy feature, especially the type completion of the object.