I'm not sure myself, honestly. I'd love to know. When I have the time, I'll try to create a rigorous experiment for this using the DevTools Memory tools.
If I were to make an educated guess, I'd say the difference in memory efficiency would be negligible.
I'm not sure myself, honestly. I'd love to know. When I have the time, I'll try to create a rigorous experiment for this using the DevTools Memory tools.
If I were to make an educated guess, I'd say the difference in memory efficiency would be negligible.
How funny is it, though, that this method is still using closures, the 5 functions capturing
privates
:DIt makes you realize that even though closures are so ubiquitous in JavaScript, not everyone truly understands it.