Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumTypeScriptkeyof and indexed accessSingle-choice MCQ

What is the type `P` produced by indexing a union with a shared key?

type A = { kind: "a"; payload: number }; type B = { kind: "b"; payload: string }; type U = A | B; type P = U["payload"];