Adds an item to the collection at the specified index.
Namespace: MindFusion.Common.Collections
File: ObservableCollection.js
SyntaxJavaScript
Copy Code
|
|---|
function insert (index, item) |
Type: Number
Number. The index.
Type: Object
Object. The object to add.
ExampleThe following code creates a List with products. Then it adds several products to it and inserts one at the beginning of the List. List derives from ObservableCollection.
JavaScript
Copy Code
|
|---|
var product1 = new Object(); var product2 = new Object(); List products = new List();
if(products.count() > 100) |
See Also