Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 3
    Underscorejs is my daily used lib. It should be definitely rated much higher for its simplicity. Commented Apr 21, 2015 at 9:46
  • Underscore has been replaced by a more superior library lodash. Since it a superset of underscore it also supports _.isEqual(a, b). check this for more details. Commented Sep 30, 2015 at 13:01
  • 2
    I like lodash, and it does contain a super-set of Underscore's features ... but it is not "superior" nor has it "replaced" Underscore. For one thing, Lodash has been so metaprogrammed and micro-optimized that its source code is basically unreadable. This matters when (say) you accidentally pass the wrong arguments to a Lodash/Underscore function and have to debug what's going on. In that case Underscore is vastly superior because (unlike Lodash) you can actually read the source. Ultimately, neither library is superior to the other, they just have different strengths and weaknesses. Commented Sep 30, 2015 at 16:15
  • As a side note, the authors of those two libraries (John-David Dalton and Jeremy Ashkenas) have recently discussed the prospect of merging them because of their commonalities. But (as you'll find if you read the GitHub thread: github.com/jashkenas/underscore/issues/2182) it was not an obvious decision. In fact, AFAIK no decision has been made in the 3+ months since, precisely because Underscore has advantages like readable source code that Underscore users don't want to lose. Commented Sep 30, 2015 at 16:22
  • 2
    Back to the topic at hand, this alerts false|false. _.isEqual(a,b) compares the elements of an array according to their order so if an order-insensitive comparison is desired then the arrays must be sorted before comparing. Commented Feb 25, 2016 at 14:55