Executes a provided function once for each element.
Namespace: MindFusion.Common.Collections
File: IEnumerable.js
SyntaxJavaScript
Copy Code
|
|---|
function forEach (callback, context) |
Type: function
function. A function to execute for each element.
Type: Object
Object. The invokation context.
ExampleThe 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) |
See Also