HH\Lib\C\first_keyx

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

This function is available as C\first_keyx() in Facebook's www repository.

Returns the first key of the given KeyedTraversable, or throws if the KeyedTraversable is empty

namespace HH\Lib\C;

function first_keyx<Tk, Tv>(
  KeyedTraversable<Tk, Tv> $traversable,
): Tk;

For possibly empty Traversables, see C\first_key.

Time complexity: O(1) Space complexity: O(1)

Parameters

Returns

  • Tk