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

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -