

What does this program print?
Trace the program the way the computer would, then make your call before running anything.
type Msg = { kind: "text"; body: string } | { kind: "ping" };
const msgs: Msg[] = [{ kind: "ping" }, { kind: "text", body: "hi" }];
console.log(msgs.map((m) => (m.kind === "text" ? m.body : "*")).join(""));