lodash.product

Calculates the Cartesian product between multiple collections.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
lodash.product
18.9.194 years ago5 years agoMinified + gzip package size for lodash.product in KB

Readme

lodash.product
_.product(...collections) Calculates the Cartesian product between multiple collections. | argument | description | | ---: | :--- | | collections | Collections to calculate the Cartesian product from. | Returns a new array.

dependencies

setup

npm

```shell npm install lodash.product ```

ES module

```javascript import 'lodash.product'; import from 'lodash'; ```

Node

```javascript require('lodash.product'); let
= require('lodash'); ```

browser

```html ```

usage

```javascript let product = .product(false, true, 'a', 'b', 'c', {}); // => false, 'a', {}, false, 'b', {}, false, 'c', {}, true, 'a', {}, true, 'b', {}, true, 'c', {} ``` --- ```javascript let array = 1, 2, 3; let product = .product(array, array); // => 1, 1, 1, 2, 1, 3, 2, 1, 2, 2, 2, 3, 3, 1, 3, 2, 3, 3 ```