开发者问题收集
如果传递空对象,对象解构将引发错误function test ({name= 'empty'}={}) {console.log(name)}test(null);Uncaught TypeError: Cannot destructure propertynameof 'undefined' or 'null'.at test (:1:15)at :1:1