Standard built-ins
Map.prototype.forEach()
Invoke callback in insertion order with (value, key, map). A supplied thisArg is used for ordinary callbacks; return values are ignored.
Formal Syntax & Structure
javascript syntaxjavascript
map.forEach(callback, [thisArg])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| callback | Function | Receives value, key and map. |
| thisArg | Any | Callback receiver. |
Return Value
Undefined
No accumulated result.
Working Example
Example Snippetjavascript
const m=new Map([["a",3]]);m.forEach((v,k)=>console.log(v,k));