Optional chaining on the left side in Javascript

前端 未结 3 1778
悲&欢浪女
悲&欢浪女 2021-01-18 15:12

Is it possible to use the optional chaining operator in the left side of an assignment = in Javascript?

c         


        
3条回答
  •  不要未来只要你来
    2021-01-18 16:01

    No, it is not possible. The documentation clearly states

    The optional chaining operator ?. permits reading the value of a property located deep within a chain of connected objects without having to expressly validate that each reference in the chain is valid.

提交回复
热议问题