Files
ihrm/node_modules/collect.js/docs/api/crossJoin.md
Nikhil Ravi Cybrosys e1794e7422 [UPDT]translations in the views (#4)
[UPDT]Translations in the views
[FIX]major bug fixes
2023-05-18 15:05:28 +05:30

20 lines
439 B
Markdown
Executable File

# `crossJoin()`
The crossJoin method cross joins the collection with the given array or collection, returning all possible permutations:
```js
const collection = collect([1, 2]);
const joined = collection.crossJoin(['a', 'b']);
joined.all();
// [
// [1, 'a'],
// [1, 'b'],
// [2, 'a'],
// [2, 'b'],
// ]
```
[View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/crossJoin.js)