Filters a sequence of values based on a predicate.
Namespace: MindFusion.Common.Collections
File: IEnumerable.js
JavaScript Copy Code |
---|
function where (selector) |
Type: function
function. A function to test each element for a condition.
IEnumerable. An collection that contains elements from the input sequence that satisfy the condition.
The following code uses the where function to search for an item in the collection of items in a TreeView:
JavaScript Copy Code |
---|
var treeNode = treeView.flatItems.where(function (item) { if (item.data == d) return true; }).first(); |