Returns the first element in the collection.
Namespace: MindFusion.Common.Collections
File: IEnumerable.js
SyntaxJavaScript
Copy Code
|
|---|
function first () |
Object. The first element in the collection.
ExampleThe 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) |
See Also