카테고리 없음

Null Propagation Operator in JavaScript

개발자_이훈규 2020. 5. 21. 21:56

오랜만에 react-navigation을 다시 보는데 javascript 문법 중에 신기한 부분이 보였다.

 

if (route.params?.post) {

    // Post updated, do something with `route.params.post`

    // For example, send the post to the server

}

 

저기 ? ??

저건 찾아보니 route.parmas && route.params.post와 동일한 의미였다.