Skip to content

Commit f6cb25e

Browse files
committed
[객체와 메서드, this] 리뷰 반영 — 에러 메시지 수정 및 마커 추가
1 parent c5b2177 commit f6cb25e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

1-js/04-object-basics/04-object-methods/article.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ let user = {
159159

160160
let admin = user;
161161
user = null; // user를 null로 덮어씁니다.
162-
163-
admin.sayHi(); // sayHi()가 엉뚱한 객체를 참고하면서 에러가 발생했습니다.
162+
*!*
163+
admin.sayHi(); // TypeError: Cannot read property 'name' of null
164+
*/!*
164165
```
165166

166167
`alert` 함수가 `user.name` 대신 `this.name`을 인수로 받았다면 에러가 발생하지 않았을 겁니다.

0 commit comments

Comments
 (0)