error TS2322: Type 'string | boolean | undefined' is not assignable to type 'string | undefined'. [19:36:01] Type 'false' is not assignable to type 'string | undefined'. code example
Example 1: Type 'string | undefined' is not assignable to type 'string'.
let name1:string = person.name as string;
Example 2: Type 'string | undefined' is not assignable to type 'string'.
let name1:string = person.name!;
// ^ note the exclamation mark here