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

254
Views
Group table data into groups of N in Typescript

I am looking for a way in Typescript to group data from table rows into all possible groups of N size?

For example:- Lets say I wanted to create groups of 3 (but this value can change) based on District (so all A's can be together, all B's etc), however I want to keep ALL the data.

So for A the groups would be as below yet keep ALL their meta data. I am in looping hell and I'm thinking there must be something I'm missing!

A Group
John, Suzie, Areli
John, Suzie, Waylon
John, Suzie, Bentley
John, Areli, Waylon
John, Areli, Bentley
Suzie, Areli, Waylon
Suzie, Areli, Bentley
Areli, Waylon, Bentley

Consider I have the following data:-

Name District Favourite Color Age Group
John A Red 1
Suzie A Green 2
Tom B Blue 1
Phillip C Blue 1
Tristen C Blue 2
Areli A Green 2
Cecilia B Blue 2
Elyse D Blue 2
Waylon A Green 2
Issac B Blue 1
Uriah C Green 2
Bentley A Green 2
Darian B Red 1
Haley C Red 2
Shaniya D Red 1
James D Green 1
about 4 years ago · Juan Pablo Isaza
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!