From 669817dd790452f7622567e70fec7a4175f4ce2e Mon Sep 17 00:00:00 2001 From: ChowQ <56550691+CFCode-git@users.noreply.github.com> Date: Mon, 26 Apr 2021 16:45:26 +0800 Subject: Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按照 ECMAScript 2020 规范,数据类型只有八种。 链接 >> https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values --- files/zh-cn/web/javascript/data_structures/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'files/zh-cn') diff --git a/files/zh-cn/web/javascript/data_structures/index.html b/files/zh-cn/web/javascript/data_structures/index.html index 5b3e069800..479e7222f9 100644 --- a/files/zh-cn/web/javascript/data_structures/index.html +++ b/files/zh-cn/web/javascript/data_structures/index.html @@ -23,7 +23,7 @@ foo = true; // foo is a Boolean now

数据类型

-

最新的 ECMAScript 标准定义了 9 种数据类型:

+

最新的 ECMAScript 标准定义了 8 种数据类型:

记住 typeof 操作符的唯一目的就是检查数据类型,如果我们希望检查任何从 Object 派生出来的结构类型,使用 typeof 是不起作用的,因为总是会得到 "object"。检查 Object 种类的合适方式是使用 {{Glossary("instanceof")}} 关键字。但即使这样也存在误差。

-- cgit v1.2.3-54-g00ecf