Hacker News new | ask | show | jobs
by deaddodo 1016 days ago
I mean, the paradigm would be a iterable-based dispatch. There's no name (that I know of) for such a specific (and yet, weirdly general) implementation.

I agree with many others in this thread when it comes to this being too specific to be useful and too generic to keep you from shooting yourself in the foot. I would, instead, add this to Array/Object's prototypes and call it on the specific types instead. At least, in that case, you aren't handling multiple fields of concern.