I have an array of values like:
const arr = [1,2,3];
Is there any way I can use destructuring to create the following output? If not, what
I don't believe there's any structuring/destructuring solution to doing that in a single step, no. I wanted something similar in this question. The old := strawman proposal doesn't seem to have legs in the new proposal list, so I don't think there's much activity around this right now.
This answer shows a very neat two-step version.
But if it's two steps, you may as well use a simple object initializer:
const arr = [1,2,3];
const obj = {
one: arr[0],
two: arr[1],
three: arr[2]
};
console.log(obj);