Import a single export from a module import { ZipCodeValidator } from "./ZipCodeValidator"; let
The Impact of ES6 on Module Plugins Some plugins add or modify top-level exports on existing modules. While this is legal in CommonJS and other
Indexable Types Similarly to how we can use interfaces to describe function types, we can also describe types that we can “index into” like
Excess Property Checks In our first example using interfaces, TypeScript let us pass { size: number; label: string; } to something
Scoping rules var declarations have some odd scoping rules for those used to other languages. Take the following example:
Optional Parameters in Callbacks Don’t use optional parameters in callbacks unless you really mean it:
Integrating with Build Tools You might have some more build steps in your pipeline. Perhaps you concatenate something to each of your files
Red flags
Global Variables Documentation The global variable foo contains the number
Array TypeScript, like JavaScript, allows you to work with arrays of values. Array types can be written in one of two ways. In the first, you
Page 11 of 29