Search
IEnumerable.toArray Method
See Also
 






Returns a new Object array, containing the contents of the collection.

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

 Syntax

JavaScript  Copy Code

function toArray ()

 Return Value

Array. The array.

 Example

The following code creates a List with products and gets its underlying array:

JavaScript  Copy Code

var product1 = new Object();
product1.title = "Ford";
product1.price = 25345;

var product2 = new Object();
product1.title = "BMW";
product1.price = 75300;
......
.....

productList.addRange([product1, product2, ...]);

var products = productList.toArray();

 See Also