Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash.product

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.product

Calculates the Cartesian product between multiple collections.

  • 17.12.17
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.7K
increased by21.42%
Maintainers
1
Weekly downloads
 
Created
Source

lodash.product

_.product(...collections)

Calculates the Cartesian product between multiple collections.

argumentdescription
collectionsIterables of values to calculate the Cartesian product from.

Returns a new array.

dependencies

  • lodash

setup

npm


npm install lodash.product

ES module


import _ from 'lodash';
import 'lodash.product';

Node


const _ = require('lodash');
require('lodash.product');

browser


<script src="https://unpkg.com/lodash"></script>
<script src="https://unpkg.com/lodash.product"></script>

usage


let product = _.product([false, true], ['a', 'b', 'c'], [{}]);
// => [[false, 'a', {}], [false, 'b', {}], [false, 'c', {}], [true, 'a', {}], [true, 'b', {}], [true, 'c', {}]]


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]]

Keywords

FAQs

Package last updated on 17 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc