HH\Lib\Vec\map

Requires the Hack Standard Library to be installed.
Facebook Engineer?

This function is available as Vec\map() in Facebook's www repository.

Returns a new vec where each value is the result of calling the given function on the original value

namespace HH\Lib\Vec;

function map<Tv1, Tv2>(
  Traversable<Tv1> $traversable,
  (function(Tv1): Tv2) $value_func,
): vec<Tv2>;

For async functions, see Vec\map_async().

Time complexity: O(n) Space complexity: O(n)

Parameters

Returns

  • vec<Tv2>