IList Customers =
flat.GroupBy(cust => new { cust.ReferenceNumber, cust.Name, cust.Address })
.Select(c => new Customer
Yes.
You can pass functions around in JavaScript, which would serve the same purpose as the lambda expressions in the C# code. Take the use of JQuery's "each" as an example:
$('div.several').each(function() {
// Do something with the current div.
});
You can also create nested objects quite easily:
var outer = {
inner1: {
val1: 'a',
val2: 'b'
},
inner2: {
val1: 'c',
val2: 'd'
}
};
Of course, you can do that dynamically, rather than all at once:
var outer = {};
outer.inner1 = {};
outer.inner1.val1 = 'a';
...
Then, to do what you're looking for, you'll need to use arrays:
var result = [];
for (var i=0; i