인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

hiskfnxh's profile image
hiskfnxh

asked

Learn TypeScript with a real-world project

Introducing the optional chaining operator

innerHTML optional 체이닝

Written on

·

1.9K

2

안녕하세요

간단한 질문 있습니다.

 

recoveredList.innerHTML = '';

이런 코드에서

recoveredList?.innerHTML=''; 의 경우

The left-hand side of an assignment expression may not be an optional property access

이렇게 나오는데 왜 안되는 건가요??

typescriptes6

Answer 1

1

captain님의 프로필 이미지
captain
Instructor

안녕하세요, 옵셔널 체이닝 연산자의 스펙상 옵셔널 체이닝과 할당을 같이 사용하실 수 없습니다. 아래 내용 참고하세요 :)

https://github.com/tc39/proposal-optional-chaining#not-supported

hiskfnxh's profile image
hiskfnxh

asked

Ask a question