Underscore.js implementation of Cartesian Product (without any mutable variable).