From 01b0e12ba27b5069248fd09235e9a7143915ee30 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:02:49 +0800 Subject: remove `notranslate` class in zh-CN --- .../web/javascript/reference/global_objects/set/@@species/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html') diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html index c950ccbf5a..c8da916aac 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html @@ -21,13 +21,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/@@species

species 属性返回默认的构造函数, 它是Set 对象的构造函数:

-
Set[Symbol.species]; // function Set()
+
Set[Symbol.species]; // function Set()

派生对象中的 Species

在一个派生集合对象中 (比如你自定义的MySet集合),  MySet 的species 属性 是 MySet 构造函数. 又或者, 你想要重写它, 让它能在你派生的类方法中能返回父级Set 对象:

-
class MySet extends Set {
+
class MySet extends Set {
   // Overwrite MySet species to the parent Set constructor
   static get [Symbol.species]() { return Set; }
 }
-- cgit v1.2.3-54-g00ecf