Skip to main content
Version: 7.2.0

flattenReduceCallback

描述

¥Description

flattenReduce 的回调函数

¥Callback for flattenReduce

首次调用回调函数时,作为参数提供的值取决于 reduce 方法是否具有 initialValue 参数。

¥The first time the callback function is called, the values provided as arguments depend on whether the reduce method has an initialValue argument.

如果为 reduce 方法提供了 initialValue:

¥If an initialValue is provided to the reduce method:

  • previousValue 参数是 initialValue。

    ¥The previousValue argument is initialValue.

  • currentValue 参数是数组中第一个元素的值。

    ¥The currentValue argument is the value of the first element present in the array.

如果未提供 initialValue:

¥If an initialValue is not provided:

  • previousValue 参数是数组中第一个元素的值。

    ¥The previousValue argument is the value of the first element present in the array.

  • currentValue 参数是数组中第二个元素的值。

    ¥The currentValue argument is the value of the second element present in the array.

定义

¥Definition

函数 (

¥function (

名称类型描述
previousValueReducer上次调用回调时返回的累积值,或 initialValue(如果提供)。
currentFeature特性当前正在处理的要素。
featureIndexnumber当前正在处理的要素的索引。
multiFeatureIndexnumber当前正在处理的多要素的索引。

)

返回

¥Returns

Reducer