HH\ImmVector::map
Returns an ImmVector
containing the results of applying an operation to
each value in the current ImmVector
public function map<Tu>(
(function(Tv): Tu) $callback,
): ImmVector<Tu>;
map()
's result contains a value for every value in the current
ImmVector
; unlike filter()
, where only values that meet a certain
criterion are included in the resulting ImmVector
.
Guide
Parameters
(function(Tv): Tu) $callback
Returns
ImmVector<Tu>
- AnImmVector
containing the results of applying a user-specified operation to each value of the currentImmVector
in turn.
Examples
See [Vector::map
](</hack/reference/class/Vector/map/#examples>) for usage examples.