You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
420 B

4 years ago
  1. # `crossJoin()`
  2. The crossJoin method cross joins the collection with the given array or collection, returning all possible permutations:
  3. ```js
  4. const collection = collect([1, 2]);
  5. const joined = collection.crossJoin(['a', 'b']);
  6. joined.all();
  7. // [
  8. // [1, 'a'],
  9. // [1, 'b'],
  10. // [2, 'a'],
  11. // [2, 'b'],
  12. // ]
  13. ```
  14. [View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/crossJoin.js)