,您好我所经历的对象拆解利用的例子在传递函数的参数在这里Object Destructuring DemoES6解构对象赋值函数参数的默认值
function drawES6Chart({size = 'big', cords = { x: 0, y: 0 }, radius = 25} = **{}**) {
console.log(size, cords, radius);
// do some chart drawing
}
// In Firefox, default values for destructuring assignments are not yet
implemented (as described below).
// The workaround is to write the parameters in the following way:
// ({size: size = 'big', cords: cords = { x: 0, y: 0 }, radius: radius =
25} = **{}**)
drawES6Chart({
cords: { x: 18, y: 30 },
radius: 30
});
任何人都可以让我知道什么是使用在最后空对象分配的原因我在上面用粗体标出了(嵌入双星)函数参数的函数吗?