Skip to content
tezvyn:
Menu

TypeScript & Web APIs

TypeScript, browser APIs, WebAssembly, PWAs

246 bites

Test yourself: Top 30 TypeScript & Web APIs interview questions →Multiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Everything in TypeScript & Web APIs, page 13

intermediate2 min read

TypeScript Function Types: Expressions vs. Signatures

TypeScript describes function shapes with type expressions or call signatures. Use a simple expression like (s: string) => void for callbacks. For functions with properties, use a call signature. The footgun: parameter names are required in type expressions.

intermediate2 min read

TypeScript Interfaces: Naming the Shape of Your Data

An interface is a contract for an object's shape, caring what properties it has, not its class. Use it to define function parameters or API responses. The footgun: TypeScript allows objects with extra properties, checking only for the required ones.

intermediate2 min read

Union Types: When a Value Can Be One of Several Things

A Union Type is an 'OR' for your types, letting a value be one of several options, like string | number. Use it for flexible function arguments or varied API responses. The footgun: you can only use properties common to all types until you narrow.

intermediate2 min read

TypeScript Type Inference: How It Knows Without Being Told

TypeScript's type inference deduces types so you don't have to annotate everything. It infers types from variable initializations and function returns. The main footgun is its 'best common type' for arrays, which can create an overly specific union type.

easy2 min read

TypeScript's Basic Types: The Building Blocks

TypeScript builds on JavaScript's primitives (string, number, boolean) by letting you explicitly declare a variable's type. This is the foundation for catching errors early. The main footgun is confusing tuples [string, number] with flexible arrays.

easy2 min read

TypeScript Type Annotations: Defining Your Data's Shape

Type annotations are contracts for your data, telling TypeScript what to expect from variables and functions. You'll use them for primitives like string or number, and for arrays like string[].

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles