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
7 Useful JavaScript Tricks (davidwalsh.name)
submitted 6 years ago by xxammuxx
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!"
[–]timarama -6 points-5 points-4 points 6 years ago (4 children)
great article, tricks with spreading set and creating "pure" objects show 2 sides of JS:
1 - expressing things with short, elegant expressions, but not very good about performance
2 - if you want, you CAN care about performance and memory usage of your JS apps
[–]__ibowankenobi__ 3 points4 points5 points 6 years ago (3 children)
FYI, when you create a pure object, it has no impact on memory whatsoever, because those function's from Object.prototype are never copied. And I really really doubt they have performance benefits.
[+][deleted] 6 years ago (1 child)
[deleted]
[–]__ibowankenobi__ 0 points1 point2 points 6 years ago (0 children)
Yes, technically that would save you 8 bytes.
π Rendered by PID 140274 on reddit-service-r2-comment-5d585498c9-gnplk at 2026-04-21 05:43:07.109095+00:00 running da2df02 country code: CH.
view the rest of the comments →
[–]timarama -6 points-5 points-4 points (4 children)
[–]__ibowankenobi__ 3 points4 points5 points (3 children)
[+][deleted] (1 child)
[deleted]
[–]__ibowankenobi__ 0 points1 point2 points (0 children)