Javatpoint Logo
Javatpoint Logo

JavaScript WeakMap has() method

The JavaScript WeakMap has() method indicates whether the ?WeakMap object contains the specified key. It returns true if the specified key is present, otherwise false.

Syntax

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

Parameter

key - It represents the key to be searched.

Return

A Boolean value.

JavaScript WeakMap has() method example

Let's see an example to determine whether the WeakMap object contains the specified key.

Test it Now

Output:

true 






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