Executes a provided function once for each element.
Namespace: MindFusion.Common.Collections
File: IEnumerable.js
JavaScript Copy Code |
---|
function forEach (callback, context) |
function. A function to execute for each element.
Object. The invokation context.
The following code uses the forEach method in the event handler of the selectionChanged event of a ListView to change the background of items:
JavaScript Copy Code |
---|
listView.selectionChanged.addEventListener(listSelectionChanged); function listSelectionChanged(sender, args) |