interface userSignUpSchema {
readonly userId: string;
readonly password: string;
}
const schema: userSignUpSchema = {
userId: '',
password: ''
};
/*
에러[1]: 직접적인 값 변경 불가능
에러 메세지: Cannot assign to 'userId' because it is a read-only property.
동웅님: 값 변경할 일이 없다면 기본적으로 접근 제한자 readonly를 지정할 것
*/
schema.userId = 'example'; // 에러[1]