Quiz · Unions and literal types · lesson 4 of 8
Quiz — the type after ??
Which type does TypeScript infer for shown?
function label(city: string | null) {
const shown = city ?? "—";
return shown;
}
console.log(label(null));Which type does TypeScript infer for shown?
function label(city: string | null) {
const shown = city ?? "—";
return shown;
}
console.log(label(null));