stevendesu / jsindex

1 stars 0 forks source link

Implement Outer Join #18

Open stevendesu opened 5 years ago

stevendesu commented 5 years ago

We currently have left-join, inner-join, and right-join.

I haven't bothered to implement outer-join yet.

We can theoretically just take advantage of the existing left-join and right-join solutions to solve this:

const left = leftMerge(...);
const right = rightMerge(...);
return left.union(right);

Unfortunately there's no union method either in JavaScript or my library, so I'll have to either implement that bit using a for loop, or write a helper for it.

Writing a helper might be the better option. How cool would it be to have these?

left.union(right);
left.intersect(right);
left.difference(right);

Yeah, that'd be cool.