HH\Lib\C\first_key

Meta Engineer?

This is available as C\first_key in the www repository.

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

namespace HH\Lib\C;

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

For non-empty Traversables, see C\first_keyx.

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

Parameters

Returns

  • ?Tk