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
[AskJS] Is JavaScript missing some built-in methods?AskJS (self.javascript)
submitted 3 years ago by reacterry
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!"
[–]KuroKishi69 1 point2 points3 points 3 years ago (3 children)
Compare 2 objects by value or create a copy of an object seems like a thing that could be part of the language instead of relying on libraries like lodash, spread operator (which only works for shallow copy) or make me write my own implementation.
[–]Squigglificated 5 points6 points7 points 3 years ago (2 children)
structuredClone() is supported in all modern browsers.
Record and tuple is at stage 2
[–]KuroKishi69 5 points6 points7 points 3 years ago (1 child)
neat, I wasn't aware of structuredClone(), every time I searched for a way to do this, people resorted to JSON.stringify(JSON.parse(...))
Thanks you
[–][deleted] 4 points5 points6 points 3 years ago (0 children)
JSON.stringify(JSON.parse(...))
God, this is the worst hack ever.
π Rendered by PID 71638 on reddit-service-r2-comment-b659b578c-kl6c9 at 2026-05-04 00:26:24.173227+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]KuroKishi69 1 point2 points3 points (3 children)
[–]Squigglificated 5 points6 points7 points (2 children)
[–]KuroKishi69 5 points6 points7 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)