Node.js examples for Array:Set Operation
Returns the cross product of two sets (arrays)
Array.prototype.cross = function (B) { var result = []; this.forEach(function (a) { B.forEach(function (b) { result.push([a,b]);/* w ww . j a v a2 s.c o m*/ }); }); return result; };