Combined Array and Object Destructuring in JavaScript
Array destructuring assigns the properties of an array to variables with the same names by default. Object destructuring assigns the properties of an object to variables with the same names by default. Here is an example.
const props = [ { A: 1, a: 'one' }, { B: 2, b: 'two' }, { C: 3, c: 'three' }]; const [ ,{ B,b },{c}] = props; //A,a undefined, B=2,b='two', C undefined, c='three'