Curriculum Collections Maps
Maps
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.
10 ready
01
pick oneDeclare an empty Go map you can write keys into immediately. Maps
02
pick oneDeclare a Go map pre-populated with initial entries. Pick the
03
pick one TypeScript: scores["nope"] gives undefined for a missing key.
04
pick oneExercise 3 pinned the trap: missing-key lookup returns the zero value,
05
fill blanks Translate the TS delete to Go. The Go builtin is a free-standing
06
fill blanks Translate Object.keys(${name}).length to Go. The builtin you
07
type one line Productive comma-ok: a getScore helper that returns the score
08
type one line TS habit: const counts: Record<string, number> = {} and you can
09
write a programWrite a complete program that counts the occurrences of each
10
write a programMaps in Go are reference types — passing a map to a function