Oh, yeah, Link can do 2D arrays of objects with .expand(), no problem. Now, this use case:
var arr = [new StrangeObject(0, 0, a1), new StrangeObject(0, 1, a2), new StrangeObject(1, 0, a3)];
var s = Link(arr).expandNamedProperties(function(a){return a.l;}).filter(even).toArray(); // s = [4, 2, 4, 0]
I have had uses for something like this in the past, usually when storing relationships between objects. For instance, a list of entities that were within a certain range of each other.
Is interesting. I could add an argument to expand, like so:
var arr = [new StrangeObject(0, 0, a1), new StrangeObject(0, 1, a2), new StrangeObject(1, 0, a3)];
var s = Link(arr).expand("l").filter(even).toArray(); // s = [4, 2, 4, 0]
I think it won't be too bad. Without the prop name it'll expand a default array. I think this would be the most efficient.
Edit:
And so it is done, and now on the bleeding edge at GitHub. Keep coming with the ideas!!
var a = [{a: [0, 1]}, {a: [2]}, {a: [3, 4, 5]}, {a: [6, 7]}];
var s = Link(a).expand("a").filter(even).toArray(); // s = [0, 2, 4, 6];
It occurred to me that you could emulate the above anyways with pluck and expand:
var a = [{a: [0, 1]}, {a: [2]}, {a: [3, 4, 5]}, {a: [6, 7]}];
var s = Link(a).pluck("a").expand().filter(even).toArray(); // s = [0, 2, 4, 6];
I just added pluck, right now.