javascript - Cross product in underscore.js? -
is there function built-in underscore give "cross product" of 2 arrays?
i have implemented cross-product this, nice if there built-in function --
domain = []; _.each(x, function(x1) { _.each(y, function(y1) { domain.push([x1,y1]); }); });
you can use _.mixin extend underscore own function.
Comments
Post a Comment