ForEach class

Iterates over the map entries and calls the provided function for each entry. The function should take two arguments: the key and the value.

var mp = {"a": 1, "b": 2, "c": 3};
mp.forEach(fun(key, value) {
    print(key + ": " + value);
});

Async example:

var mp = {"a": 1, "b": 2, "c": 3};
mp.forEach(async fun(key, value) {
    await wait(1000);
    print(key + ": " + value);
});
Inheritance

Constructors

ForEach()

Properties

arity int
finalinherited
function NativeMethodFunction<Map<String, Object>, int>
finalinherited
hashCode int
The hash code for this object.
no setterinherited
methodName String
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
targetType NativeMethodTarget
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited