Curriculum Types & methods Nil & zero values exercise 1 · mcq
Nil & zero values
Every Go type has a defined zero value — what var x T
produces without an initialiser. Match the type to its zero
value. (Themes 3.1 + 3.3 covered struct and pointer zero
values; this exercise is the canonical reference table.)
Pick the line that's CORRECT — only one matches its type's
actual zero value.
TypeScript reference
About this theme
Every type has a zero value — what an uninitialised variable of that type holds. For numbers: 0. For strings: "". For bools: false. For pointers, interfaces, maps, slices, channels, and functions: nil. nil is *not* TypeScript's undefined — it's a typed absence, and conflating "nil pointer" with "nil interface" is one of the classic Go bugs.