Using a class as an interface
  • References/JavaScript/TypeScript/Classes

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

2025-01-10 15:47:30
Watchify
  • References/JavaScript/TypeScript/Tutorials

Watchify We’ll start with Watchify to provide background compilation: npm

2025-01-10 15:47:30
replace
  • References/JavaScript/TypeScript/Symbols

Symbol.replace A regular expression method that replaces matched substrings of a string. Called by the String.prototype

2025-01-10 15:47:30
Write a simple example
  • References/JavaScript/TypeScript/Tutorials

Write a simple example Let’s write a Hello World program. In src, create the file main.ts:

2025-01-10 15:47:30
Overloads
  • References/JavaScript/TypeScript/Functions

Overloads JavaScript is inherently a very dynamic language. It’s not uncommon for a single JavaScript function to return different types of

2025-01-10 15:47:30
Types
  • References/JavaScript/TypeScript/Generics

Generic Types In previous sections, we created generic identity functions that worked over a range of types. In this section, we’ll explore

2025-01-10 15:47:30
for...of statements
  • References/JavaScript/TypeScript/Iterators & Generators

for..of statements for..of loops over an iterable object, invoking the Symbol.iterator property on the

2025-01-10 15:47:30
Add a TypeScript configuration file
  • References/JavaScript/TypeScript/Tutorials

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

2025-01-10 15:47:30
Grab our runtime dependencies
  • References/JavaScript/TypeScript/Tutorials

Grab our runtime dependencies We’ll need to grab Knockout itself, as well as something called RequireJS.

2025-01-10 15:47:30
Metadata
  • References/JavaScript/TypeScript/Decorators

Metadata Some examples use the reflect-metadata library which adds a polyfill for an

2025-01-10 15:47:30