ForEachCallback Function
Description
Callback function for the forEach function of a collection.
Syntax
function(<object> item, <number> index, <number> itemCount)Examples
The following example demonstrates ForEachCallback in a practical document-editing workflow. Callback function for the forEach function of a collection.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function forEachCallback(item, index, itemCount) {
console.log("Callback values:", { item, index, itemCount });
}
function useForEachCallback(s) {
s.forEach(forEachCallback, onTxError);
}