Skip to content

Commit d8e0096

Browse files
jyh7aViolet-Bora-Lee
authored andcommitted
[오타수정] Part 1 4.6 옵셔널 체이닝 '?.' - 옵셔널 체이닝이 필요한 이유 #939
1 parent 7abeb1d commit d8e0096

File tree

1 file changed

+1
-1
lines changed
  • 1-js/04-object-basics/07-optional-chaining

1 file changed

+1
-1
lines changed

1-js/04-object-basics/07-optional-chaining/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ alert(user.address.street); // TypeError: Cannot read property 'street' of undef
2020
또 다른 사례는 브라우저에서 동작하는 코드를 개발할 때 발생할 수 있는 문제로, 페이지에 존재하지 않는 요소에 접근해 요소의 정보를 가져오려 할 때 발생합니다.
2121

2222
```js run
23-
// querySelector(...) 호출 결과가 null인 경우 에러
23+
// querySelector(...) 호출 결과가 null인 경우 에러 발생
2424
let html = document.querySelector('.my-element').innerHTML;
2525
```
2626

0 commit comments

Comments
 (0)