Example: Below is an example of a Map.forEach() method.
1a 2b 3c
- Instance Properties: An instance property is a property that has a new copy for every new instance of the class.
|constructor||It is used to return the constructor function of Map.|
|size||Return the number of keys, and value pairs stored in a map.|
- Instance Methods: If the method is called on the instance of a Map then it is called an instance method of Map.
|clear( )||Removal of all the elements from a map and making it empty.|
|delete()||Delete the specified element among all the elements which are present in the map.|
|entries( )||Returning an iterator object which contains all the [key, value] pairs of each element of the map.|
|forEach()||The map with the given function executes the given function over each key-value pair.|
|get( )||Returning a specific element among all the elements which are present in a map.|
|has( )||Check whether an element with a specified key exists in a map or not.|
|keys()||The keys from a given map object return the iterator object of keys.|
|set()||Add key-value pairs to a Map object.|
|values()||Return a new Iterator object that contains the value of each element present in Map.|
Please Login to comment...