Im wondering whats the time complexity of turning iterables for example MapIterator into an array. lets say I have this code:
const Component = ({ map }) => {
return (
<Fragment>
{Array.from(map.values()).map(item => <div key={item.key}>{item.name}</div>)}
</Fragment>
)
}
what is the time complexity for each Array.from(), is it what Im thinking O(n) or is it because its an MapIterator somehow converted from arraylike to array quicker.
My use case is that I want to save items (which need to be accessed) as a map for performance issues, but I have to run through them as an array.
for this questions purpose I can save in state or use selectors or stuff like that
what do you guys think?