loading...

re: Front-end best practices (featuring Vue.js) VIEW POST

TOP OF THREAD FULL DISCUSSION
re: A lot of useful tips! Thank you! A practice that I always tend to follow is to prefer O(1) over O(n). What do I mean by that is that instead of ...
 

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).

code of conduct - report abuse