小于 1 分钟
Home > @hz-9/algorithm > Hashmap > has
Hashmap.has() method
Checks if the hash map contains a value for the key.
判断在哈希表中是否有该键的值。
Time complexity: O(1)
Space complexity: O(1)
Signature:
abstract has(key: K): boolean;Parameters
Parameter | Type | Description |
|---|---|---|
key | K | The key object. |
Returns:
boolean
Whether the key has a value in the hash map.