
https://www.youtube.com/watch?v=9Y-smeNBoUA 위의 영상을 정리한 포스팅입니다. 1-1. cannot read property X of undefined undefined의 'b'라는 속성을 읽을 수 없다. a.b a가 undefined a가 undefined인 이유를 찾아서 해결 때로는 undefined가 아닌 경우가 있기 때문에 if (a) { a.b = } 와 같이 a가 undefined가 아닐때에만 동작이 실행될 수 있도록 처리 (에러가 나지 않도록) 최신 문법 옵셔널 체이닝 c = a.b; a가 undefined면 똑같이 에러가 난다. (cannot read property b of undefined) c = a?.b; 에러 나지 않고 undefined 처리를 해..
Javascript
2021. 7. 25. 16:05