typeover
curriculum

Curriculum Collections Maps exercise 2 · mcq

Maps

Declare a Go map pre-populated with initial entries. Pick the idiomatic composite literal.

TypeScript reference
Pick the idiomatic Go translation

About this theme

map[K]V. Like a TS Record<K, V> or Map<K, V>. Lookup with comma-ok: v, ok := m[key]. Iteration order is undefined — every range yields a different ordering. Maps are reference types; passing a map to a function shares it.