Curriculum Types & methods Nil & zero values exercise 5 · fill-line
Nil & zero values
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.