I too prefer to just access a prop in an object rather than iterating over an array. Big O(1).
It gets worse if you're trying to write a complex algo for parsing data that comes from the server trying to give it some useful shape for the ui. (E.g. data for a table).
Sometimes I do iterate over an array (just one time) to convert it into a dictionary (an object).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Cool!
I too prefer to just access a prop in an object rather than iterating over an array.
Big O(1)
.It gets worse if you're trying to write a
complex algo
for parsing data that comes from the server trying to give it some useful shape for the ui. (E.g. data for a table).Sometimes I do iterate over an array (just one time) to convert it into a
dictionary
(an object).