Open jdalton opened 9 years ago
Thank you for your very thorough feedback! I'll let John (Resig) speak to the particulars, since he's a lot more familiar with the technical domain than I am.
One thing that may help put this chart in context: it's intended for Khan Academy employees when writing/modernizing KA code. So the "instead of" table refers to underscore constructs that are actually used in KA code. It's not meant to be an exhaustive list of all functions that exist in underscore or lodash.
One thing that may help put this chart in context: it's intended for Khan Academy employees when writing/modernizing KA code.
Yep, that's cool. Most of my comments can be seen as just adding extra info. Besides the typos or incorrect usage the rest can be taken as is (no pressure to change bits) but if something is considered notable then by all means note it up :)
Sorry for the rapid fire comments, needed to get it out before jumping into a meeting and forgetting. Continuing the feedback from #28.
In addition, Lodash is totally modular & works great with browserify / webpack to create smaller bundles. There's even a babel plugin to avoid mucking with module paths.
It would be better to compare to
_.assign
as that's closer toObject.assign
(iterating only own properties of source values instead of own+inherited in_.extend
).In Lodash there's
_.forOwn
and_.forIn
for object iteration tooThe useful bit for
_.defer
and_.delay
is they allow partially applying arguments to the deferred/delayed function, which older environments lacked insetTimeout
(may be worth noting).Typo, fix to
obj.method = obj.method.bind(obj);
This will assign
_initDone
to the outerthis
so not really appropriate for per method state.