Javatpoint Logo
Javatpoint Logo

JavaScript WeakMap get() method

The JavaScript WeakMap get() method returns the value of specified key of an element from a WeakMap object.

Syntax

The get() method is represented by the following syntax:

Parameter

key - The key to be searched.

Return

The value of the specified key.

JavaScript WeakMap get() method example

Here, we will understand get() method through various examples.

Example 1

Let's see a simple example of get() method.

Test it Now

Output:

jQuery
AngularJS
Bootstrap

Example 2

Let's see an example to determine the result when WeakMap object doesn?t contain the key.

Test it Now

Output:

undefined






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA