---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# WeakMap.prototype.get()

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

## Syntax

```js
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`](../../../globals/undefined.mdx) is returned.
