Valeur par défaut TypeScript si null
/* Use || operator to assign a default value whence the first variable
evaluates to a 'falsy' value
- Example with strings (you can replace string with any type T) */
let x: string | null = null;
let y: string = x || "My default value"
houstika