This lists all terms related to TypeScript, common and uncommon.
See also the Mozilla Developer Network glossary for terms related to JavaScript and the web.
T
being assignable to U
means that all possible values of the type T
are valid values for the type U
K
): K extends K ? T<K> : never
turns A | B | C
into T<A> | T<B> | T<C>
(HB){ a: number; }
extends { a: number | string; }
, { a: 1; }
extends { a: number; }
. TypeScript’s type system is structural
(WP)class T extends U {}
.
TypeScript doesn’t have this whatsoever
(WP)this
types) - the this
type will take the type of child classes
(WP)function returnsClosure() {
let i = 0;
return () => { i += 1; return i; };
// this closure captures `i`, and so `i` must live at least as long as this function
}
{ [K in keyof T]: Foo<T, K>; }
)
(HB){ [K in keyof T as `get${K}`]: () => T[K]; }
)T
extends U
: T extends U ? V<U> : V<T>
(HB)??
operator that returns its right operand
if its left operand is null
or undefined
(MDN)?.
operator that accesses the property
if its left operand is neiter null
nor undefined
(MDN)const f = () => {};
(MDN)const f = function () {}
, const f = function foo() {}
(MDN)(() => {})()
, (function () {})()
(MDN)