typeover
curriculum

Curriculum Foundations Conditionals & switch exercise 6 · fill-word

Conditionals & switch

Each branch of a Go switch is introduced by the same keyword. Fill in both occurrences to complete the dispatch.

TypeScript reference
Fill the blanks →

About this theme

if/else looks familiar — no parentheses, braces required. The one new shape is the short-statement-if: if err := work(); err != nil { ... }. It scopes a temporary to the condition; you'll see this everywhere in Go. switch exists and doesn't fall through by default — closer to TypeScript's switch with implicit break than to C's.