destructuring assignment doesn’t work for the field in one object holds a falsy value, as follow:
let { aaa = 123 } = { aaa: null }
console.log(aaa) // null
so, how to achive ||=
in object destructuring assignment to implement such the field’s destructed defalut value ? like this:
let { aaa ||= 123 } = { aaa: null }
console.log(aaa) // 123
// it equals to
// let aaa = ({ aaa: null }).aaa || 123