utils

Home > @silence_zhpf/utils > HashMap > mapValue

HashMap.mapValue() method

此函数使用提供的函数将HashMap对象的值映射到新数组。

Signature:

mapValue<R>(fn: (value: U, index: number, array: U[]) => R): R[];

Parameters

Parameter Type Description
fn (value: U, index: number, array: U[]) => R 接受三个参数的函数:值的“值”、键的“索引”和键的整个“数组”。

Returns:

R[]

mapValue 方法返回一个值数组。