The intention of this code is to have some personal persistance and point of view comparing JS objects and arrays mapping some values for its later search.
Recently (2021-09-01) is very common that people try to use a "fancy" way to compound structures when not in all scenarios
could the most performant. Usage of find
, map
, reduce
and is good use them when it merits, but on other cases,
organize the data based on an Object by keys can increase the performance.
Here is another point of view and probably if the intention is just iterate could make sense this approach.