Is there any concise way to set default value to null when using Javascript Destructuring

前端 未结 0 1430
广开言路
广开言路 2020-12-21 20:22

These two version isn\'t 100% the same, when value is null the result is different:

// version 1
const dogs = animal.dogs || [];
const cats = ani         


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