Standard built-ins

Map.prototype.forEach()

Try the free JavaScript compiler

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

NameTypeDescription
callbackFunctionReceives value, key and map.
thisArgAnyCallback 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));
JavaScript Reference