Answers for "argument of type string|undefined not assignable to string"

3

Type 'string | undefined' is not assignable to type 'string'.

let name1:string = person.name as string;
Posted by: Guest on April-02-2021
0

Type 'string | undefined' is not assignable to type 'string'.

let name1:string = person.name!; 
//                            ^ note the exclamation mark here
Posted by: Guest on April-02-2021

Code answers related to "argument of type string|undefined not assignable to string"

Browse Popular Code Answers by Language