Zips an object of arrays, creating objects with corresponding elements. Stops iterating when the shortest input array is exhausted.
An object containing arrays of potentially different types
Object with array values to be zipped
A generator yielding objects with one element from each input array
const data = { names: ['Alice', 'Bob'], ages: [30, 25], cities: ['New York', 'London']};[...structZip(data)]// [{ names: 'Alice', ages: 30, cities: 'New York' },// { names: 'Bob', ages: 25, cities: 'London' }] Copy
const data = { names: ['Alice', 'Bob'], ages: [30, 25], cities: ['New York', 'London']};[...structZip(data)]// [{ names: 'Alice', ages: 30, cities: 'New York' },// { names: 'Bob', ages: 25, cities: 'London' }]
Zips an object of arrays, creating objects with corresponding elements. Stops iterating when the shortest input array is exhausted.