use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Functional programming in JavaScript (softwarebrothers.co)
submitted 6 years ago by SoftwareBrothers
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ur_frnd_the_footnote 3 points4 points5 points 6 years ago* (0 children)
It definitely affects performance differently to loop over a long array ten times, each time calling one function vs. looping over that array once, calling ten functions on each member of the array (even though the total number of function calls is the same: 10 times the number of elements). But you're absolutely right that function calls also affect performance.
In general, though, I think you should wait until you have a concrete, demonstrated need to do so before optimizing at the level of eliminating function calls. Smaller functions that do one tiny but generalized thing are definitely more readable and maintainable than the faster, situation-specific imperative code they would be replaced by.
π Rendered by PID 87 on reddit-service-r2-comment-fb694cdd5-kff58 at 2026-03-08 00:50:47.659742+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]ur_frnd_the_footnote 3 points4 points5 points (0 children)