TL;DR:
So instead of creating every
row.getValue(),row.getUniqueValues(), etc. method for eachrowobject potentially millions of times, we create them just once and then assign them to therowprototype, and then just assign the prototype to the newrowobject.
They go into how their needs are too dynamic for classes as well.
Anyway, from a memory usage perspective, this makes a lot of sense. Modern JS makes liberal use of objects, but there is very little concern towards the consequences of that. Shared logic that can be decoupled from objects should be, at least from a performance standpoint.
all 6 comments