From bef8694d2188cf154cd20a23329e5ab389e5f724 Mon Sep 17 00:00:00 2001 From: helloking000 <798859380@qq.com> Date: Thu, 18 Mar 2021 14:22:25 +0800 Subject: Update index.html --- .../javascript/reference/operators/destructuring_assignment/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/zh-cn/web/javascript/reference/operators/destructuring_assignment/index.html b/files/zh-cn/web/javascript/reference/operators/destructuring_assignment/index.html index 39d57a75d7..b0b6f81ea0 100644 --- a/files/zh-cn/web/javascript/reference/operators/destructuring_assignment/index.html +++ b/files/zh-cn/web/javascript/reference/operators/destructuring_assignment/index.html @@ -209,7 +209,7 @@ console.log(bar); // true

默认值

-

变量可以先赋予默认值。当要提取的对象没有对应的属性,变量就被赋予默认值。

+

变量可以先赋予默认值。当要提取的对象对应属性解析为 undefined,变量就被赋予默认值。

var {a = 10, b = 5} = {a: 3};
 
-- 
cgit v1.2.3-54-g00ecf