Class

let userError:object; userError = { name: "cloer", age: 10 }; // console.log(user.name) // Error: Property 'name' does not exist on type 'object'. type Score = 'A'|'B'|'C'|'D'; interface User { name: string; age: number; gender?: string; //optional readonly birthYear: number; [grade:number]: Score }; let user:User = { name:'cloer', age:10, birthYear: 2012 }; user.gender = 'male'; // user.birthYe..
thecloer
'Class' 태그의 글 목록