HH\Lib\Dict\reverse

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

This function is available as Dict\reverse() in Facebook's www repository.

Returns a new dict with the original entries in reversed iteration order

namespace HH\Lib\Dict;

function reverse<Tk as arraykey, Tv>(
  KeyedTraversable<Tk, Tv> $traversable,
): dict<Tk, Tv>;

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

Parameters

Returns

  • dict<Tk, Tv>