Skip to main content

All Questions

4 votes
2 answers
1k views

Arrays vs Maps for listing items that have a unique id

I've been finding that for a lot of code I've been writing recently, it naively might look like this: Array approach: const options = [ { id: 'red', label: 'Red', data: '#f00' ...
dwjohnston's user avatar
  • 2,687