Returns the first element in the collection.
Namespace: MindFusion.Common.Collections
File: IEnumerable.js
JavaScript Copy Code |
---|
function first () |
Type: Object
Object. The first element in the collection.
The following code checks if the first item in the collection of items in a TreeNode is span:
JavaScript Copy Code |
---|
// create a tree node that will be a root in our hierarchy var span = new ui.TreeNode("span"); var elements = [span, div, p]; if (root.items.first() == span) |