3 ms·
Using an object literal is significantly superior than using a dynamic construction in any case where parameterization isn't needed. The body of that reduce loo
by barrkel 9y ago
Using an object literal is significantly superior than using a dynamic construction in any case where parameterization isn't needed. The body of that reduce looks like what you'd expect the implementation of a custom object literal initialization to look like - something where the members being iterated over are parameterized.
I'm far less fussed about function vs lambda literal bound to a const. Usually that kind of decision comes down to tooling in debuggers - depending on the runtime, turning lambdas back into names may be difficult, if you have lambdas bound to event handlers and the like.