Using a class as an interface As we said in the previous section, a class declaration creates two things: a type representing instances of the
Watchify We’ll start with Watchify to provide background compilation: npm
Symbol.replace A regular expression method that replaces matched substrings of a string. Called by the String.prototype
Write a simple example Let’s write a Hello World program. In src, create the file main.ts:
Overloads JavaScript is inherently a very dynamic language. It’s not uncommon for a single JavaScript function to return different types of
Generic Types In previous sections, we created generic identity functions that worked over a range of types. In this section, we’ll explore
for..of statements for..of loops over an iterable object, invoking the Symbol.iterator property on the
Add a TypeScript configuration file You’ll want to bring your TypeScript files together - both the code you’ll be writing as well as any necessary
Grab our runtime dependencies We’ll need to grab Knockout itself, as well as something called RequireJS.
Metadata Some examples use the reflect-metadata library which adds a polyfill for an
Page 26 of 29