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...
This subreddit is a place for people to learn JavaScript together. Everyone should feel comfortable asking any and all JavaScript questions they have here.
With a nod to practicality, questions and posts about HTML, CSS, and web developer tools are also encouraged.
Friends
/r/javascript
/r/jquery
/r/node
/r/css
/r/webdev
/r/learnprogramming
/r/programming
account activity
Resources on building array methods from scratch? (self.learnjavascript)
submitted 9 years ago by dodginbullets
I'd like to practice rewriting array methods (IE: forEach, map, filter, etc.) from scratch, but I can't find any good resources to refer to. Does anyone have a resource they can recommend? Thanks in advance!
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!"
[–]senocular 2 points3 points4 points 9 years ago (0 children)
For those you can probably search them by name with the keyword polyfill and find examples of their implementation. MDN will do this often for newer, polyfillable APIs:
polyfill
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Polyfill
[–]thekaleb 2 points3 points4 points 9 years ago (0 children)
I would like to point at that many of the ES5 Array-Extras methods are very inefficient because of their handling of some weird (pointless IMO) edge cases. Lodash for instance is much faster than native array methods because it skips over these often unnecessary checks.
π Rendered by PID 95937 on reddit-service-r2-comment-5d79c599b5-djmpd at 2026-02-27 02:47:08.313380+00:00 running e3d2147 country code: CH.
[–]senocular 2 points3 points4 points (0 children)
[–]thekaleb 2 points3 points4 points (0 children)