Skip to content

Instantly share code, notes, and snippets.

@Kiwka
Created February 6, 2020 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kiwka/309a3f52433ef8b43053b532d6159604 to your computer and use it in GitHub Desktop.
Save Kiwka/309a3f52433ef8b43053b532d6159604 to your computer and use it in GitHub Desktop.
Calculating options by using cartesian product
cartesian([arr1, arr2, arr3, arr4]).forEach(
(option1, option2, option3, option4) => {
// use option1, option2, option3, option4 here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment