HH\Lib\Vec\shuffle

Meta Engineer?

This is available as Vec\shuffle in the 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>;

Vec\shuffle is not using cryptographically secure randomness.

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

Parameters

Returns

  • vec<Tv>