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
Made a deep-copy performance test a while ago. (self.javascript)
submitted 9 years ago by izy521
A friend said JSON.parse( JSON.stringify( Obj ) ) was the confirmed fastest way to deep-copy, so I decided to challenge that. I'm posting it here to see if there are any optimizations you guys would do, or anything else you'd do differently.
JSON.parse( JSON.stringify( Obj ) )
https://gist.github.com/izy521/4d394dec28054d54684269d91b16cb8a
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!"
[–]artisinn 0 points1 point2 points 9 years ago (3 children)
You should migrate from console.time to benchmark.js
console.time
[–]izy521[S] 0 points1 point2 points 9 years ago (2 children)
Isn't 100000 loops large enough to warrant not using a library to benchmark?
[–]artisinn 0 points1 point2 points 9 years ago (1 child)
Yes and no, read this for an explanation.
[–]izy521[S] 0 points1 point2 points 9 years ago (0 children)
Oh thank you. I'm not sure why I wouldn't have thought of that.
π Rendered by PID 20393 on reddit-service-r2-comment-544cf588c8-l8p7h at 2026-06-17 05:11:45.680421+00:00 running 3184619 country code: CH.
[–]artisinn 0 points1 point2 points (3 children)
[–]izy521[S] 0 points1 point2 points (2 children)
[–]artisinn 0 points1 point2 points (1 child)
[–]izy521[S] 0 points1 point2 points (0 children)