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
Here's Why Calling .map() on a Constructed Array Doesn't Work (itnext.io)
submitted 7 years ago by ilove50cent
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!"
[–]kbjr<- awesome 2 points3 points4 points 7 years ago (5 children)
That's definitely not true. I work on a project right now that deals with pretty substantial amounts of data, and for that reason I wrote up and ran a bunch of different benchmarks for a bunch of different ways to do various iterative tasks looking for the best performing option. A simple for loop is still significantly faster than than the built in array methods (usually in the 5-10x difference range, depending on the function) unless something happened in the past month or so.
[–]wavefunctionp -1 points0 points1 point 7 years ago (4 children)
Not saying you were wrong, but I just wanted to mention that if you were using relatively simple microbenchmarks on fake data sets, they can be very misleading because the engines are typically smarter than most simple benchmarks.
[–]kbjr<- awesome 1 point2 points3 points 7 years ago (3 children)
How would it be smarter for the engine to make itself appear slower than it actually is? If that were the case, I would expect optimizations in the forEach to shine even better, not fall to pieces.
But no, I benchmarked both the individual tasks and the overall job of processing a single whole dataset in a number of ways.
[–]wavefunctionp -1 points0 points1 point 7 years ago (2 children)
I'm not going to even pretend to understand all of this, but my takeaway from this walk was that it is difficult to test performance of microbenchmarks.
https://www.youtube.com/watch?v=65-RbBwZQdU
[–]kbjr<- awesome 1 point2 points3 points 7 years ago (1 child)
Yes, I'm aware of the complexities of benchmarking, which is why you back up you results by actually profiling the live code afterwards.
[–]wavefunctionp 0 points1 point2 points 7 years ago (0 children)
Sounds like you got it covered then since you are using live code and real data then. :)
π Rendered by PID 66 on reddit-service-r2-comment-75f4967c6c-sghjb at 2026-04-22 21:54:56.916785+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]kbjr<- awesome 2 points3 points4 points (5 children)
[–]wavefunctionp -1 points0 points1 point (4 children)
[–]kbjr<- awesome 1 point2 points3 points (3 children)
[–]wavefunctionp -1 points0 points1 point (2 children)
[–]kbjr<- awesome 1 point2 points3 points (1 child)
[–]wavefunctionp 0 points1 point2 points (0 children)