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

86
Views
How to order an object of objects by combining some of its values

I've seen this question answered before, but not quite what I was looking for I have an object like:

const obj = {
    'a': {
        name: 'someName',
        dimension1: '19',
        dimension2: '8',
        ...
    }
    'b': {
        name: 'someName',
        dimension1: '19',
        dimension2: '9',
        ...
    }
    'c': {
        name: 'someName',
        dimension1: '19',
        dimension2: '8.5',
        ...
    }
    'd': {
        name: 'someName',
        dimension1: '19',
        dimension2: '8.5',
        ...
    }
}

I want to reorder the object like so:

Order it by a string dimension1xdimension2

So for obj[a] would be something like '19x8'

The corect ordered keys for the obj would be: a, c, d, b Because: '19x8, '19x8.5', '19x8.5', '19x.9'

How can I achieve this ?

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!