typeover
curriculum

Curriculum Types & methods Structs exercise 5 · fill-word

Structs

Type the FIELD NAME that's missing from this struct literal. Named fields are positional-order-INDEPENDENT — the compiler pairs key: value by the field name, so authors can list them in any order and adding a field upstream doesn't shift the meaning of existing literals.

TypeScript reference
Fill the blanks →

About this theme

type Foo struct { ... }. A struct is a typed record — fields and their types, nothing else. No methods on the struct itself (those come next). Field access with .. Struct literals can be positional or named; named is the only sane choice for anything with more than two fields.