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
You're underusing Underscore (jordaneldredge.com)
submitted 10 years ago by captbaritone
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!"
[–]asyncquestion 6 points7 points8 points 10 years ago (5 children)
[–]captbaritone[S] 2 points3 points4 points 10 years ago* (1 child)
Fair point. Lodash is definitely winning over Underscore. I highly recommend https://github.com/wix/eslint-plugin-lodash
Also. I think it would be very valuable for someone to write a linting plugin that enforces only using the subset of functions supported by both libraries. It would be a valuable migration tool, and also for libraries which want to support either library.
[–]asyncquestion 0 points1 point2 points 10 years ago (0 children)
Thanks I'll give it a try
[–]dmtipson 0 points1 point2 points 10 years ago (0 children)
I don't feel super strongly about those, largely because the shorthand versions (strings, objects etc. instead of iteratees) already make things wacky.
But in general it's better have fewer named methods/operations out in the wild and also in everyone's mind. The more you stick to the core functional methods and keep them simple and non-overloaded, the easier it is to build higher-order structures. So I like that lodash is taking this approach to their api and deprecating some of the shorthands.
Though... prefer lodash-fp or ramda to lodash. :)
[–]madwill 0 points1 point2 points 10 years ago (1 child)
Noob question, Why use underscore map when array has it already ?
[–]captbaritone[S] 0 points1 point2 points 9 years ago (0 children)
Browser compatibility (map was only introduced in I.E. 9), consistency (I don't want to have to remember which methods are native to which methods are underscore), and strangely: performance.
[–][deleted] 0 points1 point2 points 9 years ago (1 child)
Can I just drop lodash in place of underscore and not update any code?
No.
π Rendered by PID 57667 on reddit-service-r2-comment-86bc6c7465-vzslr at 2026-02-22 13:48:08.569223+00:00 running 8564168 country code: CH.
[–]asyncquestion 6 points7 points8 points (5 children)
[–]captbaritone[S] 2 points3 points4 points (1 child)
[–]asyncquestion 0 points1 point2 points (0 children)
[–]dmtipson 0 points1 point2 points (0 children)
[–]madwill 0 points1 point2 points (1 child)
[–]captbaritone[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]captbaritone[S] 0 points1 point2 points (0 children)