i am trying to destructure an array and return an object. but the key is not working inside the object. but outside of the object destructuring happening smoothly.
let [key, value] = ["b", 2];
let object = { key: value };
console.log(object); // {key: 2}
console.log(key, value)// b, 2