-
Notifications
You must be signed in to change notification settings - Fork 11
toArray()
suckgamoni edited this page May 15, 2013
·
1 revision
Creates an array from an iterable object.
Return Value
An array that contains the elements from the input sequence.
var packages = [
{ company: "Coho Vineyard", weight: 25.2 },
{ company: "Lucerne Publishing", weight: 18.7 },
{ company: "Wingtip Toys", weight: 6.0 },
{ company: "Adventure Works", weight: 33.8 } ];
var companies = from(packages).select("$company").toArray();
for (var i = 0; i < companies.length; ++i) {
console.log(companies[i]);
}
/*
This code produces the following output:
Coho Vineyard
Lucerne Publishing
Wingtip Toys
Adventure Works
*/