Union Types
  • References/JavaScript/TypeScript/Advanced Types

Union Types Union types are closely related to intersection types, but they are used very differently. Occasionally, you’ll run into a library

2025-01-10 15:47:30
typeof type guards
  • References/JavaScript/TypeScript/Advanced Types

typeof type guards Let’s go back and write the code for the version of padLeft that uses union types. We could write

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

Test Run the project. You should see a message when you type in the input boxes:

2025-01-10 15:47:30
<reference>-ing a module
  • References/JavaScript/TypeScript/Namespaces & Modules

/// <reference>-ing a module A common mistake is to try to use the /// <reference ... /> syntax to refer

2025-01-10 15:47:30
Grunt
  • References/JavaScript/TypeScript/Project Configuration

Grunt

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

Symbol.search A regular expression method that returns the index within a string that matches the regular expression. Called by

2025-01-10 15:47:30
Polymorphic this types
  • References/JavaScript/TypeScript/Advanced Types

Polymorphic this types A polymorphic this type represents a type that is the subtype of the containing class

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

Decorator Composition Multiple decorators can be applied to a declaration, as in the following examples:

2025-01-10 15:47:30
Deep Dive
  • References/JavaScript/TypeScript/Declaration Files

Deep Dive For seasoned authors interested in the underlying mechanics of how declaration files work, the

2025-01-10 15:47:30
Dependencies on Global Libraries
  • References/JavaScript/TypeScript/Declaration Files

Dependencies on Global Libraries If your library depends on a global library, use a /// <reference types="..." /> directive:

2025-01-10 15:47:30