Nullish Coalescing Postfix Operator?

前端 未结 0 1307
伪装坚强ぢ
伪装坚强ぢ 2021-01-16 05:47

I want to increment a property value, but initialize it to 0 if it doesn\'t exist.

This works, but is a little clunky:

x = { };
let i = 0;
x[i] = (x[i]         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题