JavaScript Map entries() method

The JavaScript map entries() method returns an object of new map iterator. This object contains the key-value pair for each element. It maintains insertion order.

Syntax

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

Return Value

A new object of map iterator.

JavaScript Map entries() method example

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

Example 1

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

Test it Now

Output:

1,jQuery
2,AngularJS
3,Bootstrap

Example 2

Let's see the same example using for loop.

Test it Now

Output:

1,jQuery
2,AngularJS
3,Bootstrap

Next TopicJavaScript Math




Latest Courses