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

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