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 ?