Let me create an object as below:
let refs = {
'key1': {name: 'one'},
'key2': {name: 'two'},
'key3': {name: 'three'}
};
I want to reorder keys. For example: moving 'key2' to the last. How can I do this?
I have tried the following solution, but it doesn't effect.
let temp = refs['key2'];
delete refs['key2'];
let refsCloned = _.clone(refs);
refsCloned['key2'] = temp;