HH\Lib\Vec\shuffle

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

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

Returns a new vec with the values of the given Traversable in a random order

namespace HH\Lib\Vec;

function shuffle<Tv>(
  Traversable<Tv> $traversable,
): vec<Tv>;

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

Parameters

Returns

  • vec<Tv>