From 8d1313c84cc82d81363ed62b75baedb9a65ff2e3 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:08:24 +0800 Subject: remove font tag in zh-CN --- .../zh-cn/web/javascript/reference/global_objects/array/from/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/array/from') diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/from/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/from/index.html index 28e693f567..8cab100d7c 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/array/from/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/array/from/index.html @@ -49,7 +49,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/from
  • 可迭代对象(可以获取对象中的元素,如 Map和 Set 等)
  • -

    Array.from() 方法有一个可选参数 mapFn,让你可以在最后生成的数组上再执行一次 {{jsxref("Array.prototype.map", "map")}} 方法后再返回。也就是说 Array.from(obj, mapFn, thisArg) 就相当于 Array.from(obj).map(mapFn, thisArg), 除非创建的不是可用的中间数组。 这对一些数组的子类,typed arrays 来说很重要, 因为中间数组的值在调用 map() 时需要是适当的类型。

    +

    Array.from() 方法有一个可选参数 mapFn,让你可以在最后生成的数组上再执行一次 {{jsxref("Array.prototype.map", "map")}} 方法后再返回。也就是说 Array.from(obj, mapFn, thisArg) 就相当于 Array.from(obj).map(mapFn, thisArg), 除非创建的不是可用的中间数组。 这对一些数组的子类,typed arrays 来说很重要, 因为中间数组的值在调用 map() 时需要是适当的类型。

    from()length 属性为 1 ,即 Array.from.length === 1

    -- cgit v1.2.3-54-g00ecf