HH\Lib\Keyset\take

This API is part of the Hack Standard Library, not HHVM itself.

Returns a new keyset containing the first $n elements of the given Traversable

namespace HH\Lib\Keyset;

function take<Tv as arraykey>(
  Traversable<Tv> $traversable,
  int $n,
): keyset<Tv>;

If there are duplicate values in the Traversable, the keyset may be shorter than the specified length.

To drop the first $n elements, see Keyset\drop().

Parameters