Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
To make SKU combination in JS

Let's just say I have an array with n number of index:

0:{prop1: 'abc', prop2: ['1', '2', '3'],
1:{prop1: 'xyz', prop2: ['8', '6']

Now, what I am trying to make is a combination like this:

(1,8)
(1,6)
(2,8)
(2,6)
(3.8)
(3,6)

I have tried multiple methods couldn't achieve this combination

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Check CartesianProduct class from package js-combinatorics, I think this is the right tool for your task:

let it = new CartesianProduct('123','86');
it.length;  // 6
[...it];    /* [
  ['1', '8'],
  ['2', '8'],
  ['3', '8'],
  ['1', '6'],
  ['2', '6'],
  ['3', '6']
] */
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!