convert collection into array key and valye code example
Example 1: object to array javascript
Object.values(obj)
Example 2: js convert obj to array
const array = [
['key', 1],
['two', 2],
];
Object.fromEntries(array);
// { one: 1, two: 2 }