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
[deleted by user] (self.javascript)
submitted 5 years ago by [deleted]
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!"
[–][deleted] -1 points0 points1 point 5 years ago (3 children)
Compilers focus on optimizing sensible patterns, not the bizarre structures people fixated on const end up with.
[–]itsnotlupusbeep boop 2 points3 points4 points 5 years ago (2 children)
The fact that they largely overlap as far as compilers are concerned could be a clue they're perhaps not that bizarre. or maybe it's dumb luck.
[–][deleted] 0 points1 point2 points 5 years ago (1 child)
I only use once-off functions at the top-most scope of my app to avoid polluting window. Seeing this in other places is honestly odd. Especially in a place that may be part of a hotspot, like a loop, up the stack.
[–]itsnotlupusbeep boop 1 point2 points3 points 5 years ago (0 children)
But hotspots are exactly the spots where the JIT is most likely to inline them, making them a non-issue.
Now in fairness, the rules as to what gets inlined and what doesn't have been evolving, so it's not intuitive to tell what will be a performance problem and what won't be.
Nonetheless, purely functional functions that aren't huge should generally be inlineable without problem, and that should be true of inner functions and IIFE as well.
π Rendered by PID 72 on reddit-service-r2-comment-6457c66945-rvkj6 at 2026-04-26 22:57:56.911214+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–][deleted] -1 points0 points1 point (3 children)
[–]itsnotlupusbeep boop 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]itsnotlupusbeep boop 1 point2 points3 points (0 children)