Skip to main content
Version: 3.45.0

WeakMap.prototype.get()

The get() method returns a specified element from a WeakMap object.

Syntax​

get(key)

Parameters​

  • key
    • : Required. The key of the element to return from the WeakMap object.

Return value​

The element associated with the specified key in the WeakMap object. If the key can't be found, undefined is returned.