Untitled
unknown
javascript
2 years ago
435 B
3
Indexable
// option 1 const grouped = { A: [ { name: 'Argentina' }, // ... ], B: [ { name: 'Bulgaria' }, // ... ], // ... } // option 2 const groups = [ { group: 'A', items: [ { name: 'Argentina' }, // ... ] }, { group: 'B', items: [ { name: 'Bulgaria' }, // ... ] }, // ... ]