Having
x = {a: true, z: false, c: true, x: true, b: false}
I need to obtain the sorted by value object (true
first)
xs = {a: true, c: true, x: true, z: false, b: false}
I tried
let x = {a: true, z: false, c: true, x: true, b: false};
console.log ({...Object.entries(x).sort((a, b) => b[1]-a[1])})
but it gives me the zero indexed map... NOK...