Public

TypeScript

public, private 키워드

public 키워드 class User { public name: string; constructor(){ this.name = 'kim'; } } let 유저1 = new User(); 유저1.name = 'park'; //가능 속성값을 어디서나 수정할 수 있음. private 키워드 class User { public name :string; private familyName :string; constructor(){ this.name = 'kim'; let hello = this.familyName + '안녕'; //가능 } } let 유저1 = new User(); 유저1.name = 'park'; //가능 유저1.familyName = 456; //에러 발생 class { } 안에서만 속성값 수..