Search
IEnumerable.count Method
See Also
 






Gets the number of elements.

Namespace: MindFusion.Common.Collections
File: IEnumerable.js

 Syntax

JavaScript  Copy Code

function count ()

 Return Value

Number. The number of elements.

 Example

The following code checks if the count of items in a TreeNode is greater than 10:

JavaScript  Copy Code

// create a tree node that will be a root in our hierarchy
var root = new ui.TreeNode("body");
root.expanded = true;

var span = new ui.TreeNode("span");
var div = new ui.TreeNode("div");
var p = new ui.TreeNode("p");

var elements = [span, div, p];
root.items.addRange(elements);
.......................

if (root.items.count() > 10)
{
 //do something
}

 See Also