iterates over all items of a data collection
forEach(callback: (item: object, index?: number, array?: object[]) => any): void;
Parameters:callback: function
- a function that will iterate over items of a data collection. The function is called with the following parameters:
item
- the object of an itemindex
- the index of an itemarray
- an array of items the method was called uponExample
component.data.forEach(function(item, index, array) {
console.log("This is an item of dataCollection: ", item);
console.log("This is an index of the element: ", index);
console.log("This is an array of the elements: ", array);
});
Related sample: Data. ForEach
Change log:added in v6.4
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4