Javatpoint Logo
Javatpoint Logo

JavaScript Map get() method

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

Syntax

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

Parameter

key - The key to be searched.

Return

The value of specified key.

JavaScript Map 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 map object doesn?t contain the specified key element.

Test it Now

Output:

undefined

Next TopicJavaScript Math





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