#Help understanding the code
11 messages · Page 1 of 1 (latest)
im guessing so when you see
const response: APIResponse = [...]
you know it's the right type but can highlight it and see the detailed fields if you need to
but that line export type APIResponse= VocabType[]; actually treats VocabType as if it was a variable. Thiat is where my confusion is
it doesnt treat it as a variable
VocabType is a word that means ```ts
{
code: string;
recordsHeld: number;
label: string;
}
`APIResponse` is a word that means a list of `VocabType`s, more like a synonym than anything
its just binding words (symbols) to meanings (types) to help people understand what theyre supposed to represent