Null-safe property access (and conditional assignment) in ES6/2015

后端 未结 10 1166
[愿得一人]
[愿得一人] 2020-11-22 13:00

Is there a null-safe property access (null propagation / existence) operator in ES6 (ES2015/JavaScript.next/Harmony) like ?. in

10条回答
  •  一向
    一向 (楼主)
    2020-11-22 13:35

    Going by the list here, there is currently no proposal to add safe traversal to Ecmascript. So not only is there no nice way to do this, but it is not going to be added in the forseeable future.

提交回复
热议问题