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.

  • 18.10.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

lodash.product

_.product(...collections)

Calculates the Cartesian product between multiple collections.

argumentdescription
collectionsCollections to calculate the Cartesian product from.

Returns a new array.

setup

npm

npm i lodash.product

ES module

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

Node

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

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 18 Dec 2022

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