mapLength (Function)

Signature: mapLength(map: Map<string, t0>) -> int

Description: Returns the number of entries in a map. O(1).

Parameters

  • map (Map<string, t0>): The map

Returns: int

Example

mapLength({"a": 1, "b": 2})  // 2
mapLength ["a" => 1, "b" => 2]  // 2