Let's say I'm using a method in this way:
const {a, b} = foobar()
// or...
const obj = foobar()
const {a, b} = obj
Is there a way from within the foobar
function to tell whether it's result is being destructured immediately, or stored in a variable / constant? Or would it have no context at that point / in that scope, other than if you passed it in the arguments?
// Is this the only way?
const {a, b} = foobar({ isDestructured: true })