typeover
curriculum

Curriculum Memory ArrayList exercise 4 · fill-word

ArrayList

Fill the missing field name. The ArrayList exposes its live elements via this []T slice — used for length, iteration, and direct indexing. Five letters.

TypeScript reference
Fill the blanks →

About this theme

ArrayList(T) is Zig's growable slice — your TypeScript Array equivalent. In Zig 0.16 it's an unmanaged container by API convention: you initialize with the .empty literal, pass the allocator on every mutating call (append, insert, etc.), and call .deinit(allocator) to release. items is a []T view into the live elements; the capacity is hidden. The benefit of unmanaged: no per-list allocator pointer overhead, and the list type is a plain struct you can store in a hash map's value.