타입스크립트
[Typescript] 타입스크립트 non-null 단언 연산자 (Non-null assertion operator)
[Typescript] 타입스크립트 non-null 단언 연산자 (Non-null assertion operator)
2022.06.05🎯 Non-null assertion operator A new ! post-fix expression operator may be used to assert that its operand is non-null and non-undefined in contexts where the type checker is unable to conclude that fact !연산자는 앞의 값이 null or undefined가 아니라는 단언할 때 사용한다. // Compiled with --strictNullChecks function validateEntity(e?: Entity) { // e는 null또는 유효한 값일 수 있다. } function processEntity(e?: Entity) { validate..