HH\Vector::map

Returns a Vector containing the results of applying an operation to each value in the current Vector

public function map<Tu>(
  (function(Tv):Tu) $callback,
): Vector<Tu>;

map()'s result contains a value for every value in the current Vector; unlike filter(), where only values that meet a certain criterion are included in the resulting Vector.

Parameters

  • (function(Tv):Tu) $callback - The callback containing the operation to apply to the current Vector's values.

Return Values

  • Vector<Tu> - A Vector containing the results of applying a user-specified operation to each value of the current Vector in turn.