#jstip Sort an object literal in ascending order with 1 line of code:
Object.fromEntries(Object.entries(obj).sort((a, b) => a[1] - b[1]));
Swap a[1] and b[1] to get descending order.
ALT Console screenshot that runs this snippet on let obj = {a: 1, b: 100, c: -1, d: -300};