You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sum is called, the iterator function is always created. It is one of unnecessary memory allocations. The code is rewritten to follow next example.
Another good reason to name a function, or to save some intermediate result in a named variable, is that it gives a free opportunity to describe your intent, if you're somewhat good with descriptive naming. Very useful for future maintenance programmers, probably your future self.
reasons to name functions:
Source: http://elijahmanor.com/talks/js-smells/#/11/3
Related: https://www.youtube.com/watch?v=_0W_822Dijg
The text was updated successfully, but these errors were encountered: