Lodash Min Js Download Manager
Why would someone prefer either the lodash.js. The size of the resulting bundle and the effect on the boot or download time. Lodash.min.js is 72,5 kB. Download Tool zum Entfernen master.src.com Fehler. Master.src.com Fehler kann verursacht werden durch. Mcanvas[1].js - Unknown file version.
Why would someone prefer either the lodash.js or underscore.js utility library over the other?
Lodash seems to be a drop-in replacement for underscore, the latter having been around longer.
I think both are brilliant, but I do not know enough about how they work to make an educated comparison, and I would like to know more about the differences.
Cœurclosed as primarily opinion-based by user3942918, TylerH, Matthieu Brucher, Nkosi, Paul RoubJan 20 at 23:25
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
12 Answers
I created Lo-Dash to provide more consistent cross-environment iteration support for arrays, strings, objects, and arguments objects1. It has since become a superset of Underscore, providing more consistent API behavior, more features (like AMD support, deep clone, and deep merge), more thorough documentation and unit tests (tests which run in Node, Ringo, Rhino, Narwhal, PhantomJS, and browsers), better overall performance and optimizations for large arrays/object iteration, and more flexibility with custom builds and template pre-compilation utilities.
Because Lo-Dash is updated more frequently than Underscore, a lodash underscore build is provided to ensure compatibility with the latest stable version of Underscore.
At one point I was even given push access to Underscore, in part because Lo-Dash is responsible for raising more than 30 issues; landing bug fixes, new features, & perf gains in Underscore v1.4.x+.
In addition there are at least 3 Backbone boilerplates that include Lo-Dash by default and Lo-Dash is now mentioned in Backbone’s official documentation.
Check out Kit Cambridge's post, Say 'Hello' to Lo-Dash, for a deeper breakdown on the differences between Lo-Dash and Underscore.
Footnotes:
- Underscore has inconsistent support for arrays, strings, objects, and
argumentsobjects. In newer browsers, Underscore methods ignore holes in arrays, 'Objects' methods iterateargumentsobjects, strings are treated as array-like, and methods correctly iterate functions (ignoring their 'prototype' property) and objects (iterating shadowed properties like 'toString' and 'valueOf'), while in older browsers they will not. Also, Underscore methods like_.clonepreserve holes in arrays, while others like_.flattendon't.
Lo-Dash is inspired by underscore, but nowadays is superior solution. You can make your custom builds, have a higher performance, support AMD and have great extra features. Check this Lo-Dash vs Underscore benchmarks on jsperf and. this awesome post about lo-dash:
One of the most useful feature when you work with collections, is the shorthand syntax:
(taken from lodash docs)
neikerneikerIf like me you were expecting a list of usage differences between underscore and lodash, there's a guide for migrating from underscore to lodash.
Australian solar radiation data handbook. Daily solar radiation graph. R. & Australian and New Zealand Solar Energy Society. & Energy Partners. Catalogue Persistent Identifier APA Citation Lee, T. [Frenchs Forest, N.S.W.]: Australian and New Zealand Solar Energy Society MLA Citation Lee, T.
Here's the current state of it for posterity:
- Underscore
_.anyis Lodash_.some - Underscore
_.allis Lodash_.every - Underscore
_.composeis Lodash_.flowRight - Underscore
_.containsis Lodash_.includes - Underscore
_.eachdoesn’t allow exiting by returningfalse - Underscore
_.findWhereis Lodash_.find - Underscore
_.flattenis deep by default while Lodash is shallow - Underscore
_.groupBysupports an iteratee that is passed the parameters(value, index, originalArray), while in Lodash, the iteratee for_.groupByis only passed a single parameter:(value). - Underscore
_.indexOfwith 3rd parameterundefinedis Lodash_.indexOf - Underscore
_.indexOfwith 3rd parametertrueis Lodash_.sortedIndexOf - Underscore
_.indexByis Lodash_.keyBy - Underscore
_.invokeis Lodash_.invokeMap - Underscore
_.mapObjectis Lodash_.mapValues - Underscore
_.maxcombines Lodash_.max&_.maxBy - Underscore
_.mincombines Lodash_.min&_.minBy - Underscore
_.samplecombines Lodash_.sample&_.sampleSize - Underscore
_.objectcombines Lodash_.fromPairsand_.zipObject - Underscore
_.omitby a predicate is Lodash_.omitBy - Underscore
_.pairsis Lodash_.toPairs - Underscore
_.pickby a predicate is Lodash_.pickBy - Underscore
_.pluckis Lodash_.map - Underscore
_.sortedIndexcombines Lodash_.sortedIndex&_.sortedIndexOf - Underscore
_.uniqby aniterateeis Lodash_.uniqBy - Underscore
_.whereis Lodash_.filter - Underscore
_.isFinitedoesn’t align withNumber.isFinite
(e.g._.isFinite('1')returnstruein Underscore butfalsein Lodash) - Underscore
_.matchesshorthand doesn’t support deep comparisons
(e.g._.filter(objects, { 'a': { 'b': 'c' } })) - Underscore ≥ 1.7 & Lodash
_.templatesyntax is_.template(string, option)(data) - Lodash
_.memoizecaches areMaplike objects - Lodash doesn’t support a
contextargument for many methods in favor of_.bind - Lodash supports implicit chaining, lazy chaining, & shortcut fusion
- Lodash split its overloaded
_.head,_.last,_.rest, &_.initialout into_.take,_.takeRight,_.drop, &_.dropRight
(i.e._.head(array, 2)in Underscore is_.take(array, 2)in Lodash)
In addition to John's answer, and reading up on lodash (which I had hitherto regarded as a 'me-too' to underscore), and seeing the performance tests, reading the source-code, and blog posts, the few points which make lodash much superior to underscore are these:
It's not about the speed, as it is about consistency of speed (?)
If you look into underscore's source-code, you'll see in the first few lines that underscore falls-back on the native implementations of many functions. Although in an ideal world, this would have been a better approach, if you look at some of the perf links given in these slides, it is not hard to draw the conclusion that the quality of those 'native implementations' vary a lot browser-to-browser. Firefox is damn fast in some of the functions, and in some Chrome dominates. (I imagine there would be some scenarios where IE would dominate too). I believe that it's better to prefer a code whose performance is more consistent across browsers.
Do read the blog post earlier, and instead of believing it for its sake, judge for yourself by running the benchmarks. I am stunned right now, seeing a lodash performing 100-150% faster than underscore in even simple, native functions such as
Array.everyin Chrome!The extras in lodash are also quite useful.
- As for Xananax's highly upvoted comment suggesting contribution to underscore's code: It's always better to have GOOD competition, not only does it keep innovation going, but also drives you to keep yourself (or your library) in good shape.
Here is a list of differences between lodash, and it's underscore-build is a drop-in replacement for your underscore projects.
kumarharshkumarharshThis is 2014 and a couple of years too late. Still I think my point holds:
IMHO this discussion got blown out of proportion quite a bit. Quoting the aforementioned blog post:
Most JavaScript utility libraries, such as Underscore, Valentine, and wu, rely on the “native-first dual approach.” This approach prefers native implementations, falling back to vanilla JavaScript only if the native equivalent is not supported. But jsPerf revealed an interesting trend: the most efficient way to iterate over an array or array-like collection is to avoid the native implementations entirely, opting for simple loops instead.
As if 'simple loops' and 'vanilla Javascript' are more native than Array or Object method implementations. Jeez ..
It certainly would be nice to have a single source of truth, but there isn't. Even if you've been told otherwise, there is no Vanilla God, my dear. I'm sorry. The only assumption that really holds is that we are all writing Javascript code that aims at performing well in all major browsers, knowing that all of them have different implementations of the same things. It's a bitch to cope with, to put it mildly. But that's the premise, whether you like it or not.
Maybe y'all are working on large scale projects that need twitterish performance so that you really see the difference between 850,000 (underscore) vs. 2,500,000 (lodash) iterations over a list per sec right now!
I for one am not. I mean, I worked projects where I had to address performance issues, but they were never solved or caused by neither Underscore nor Lo-Dash. And unless I get hold of the real differences in implementation and performance (we're talking C++ right now) of lets say a loop over an iterable (object or array, sparse or not!), I rather don't get bothered with any claims based on the results of a benchmark platform that is already opinionated.
It only needs one single update of lets say Rhino to set its Array method implementations on fire in a fashion that not a single 'medieval loop methods perform better and forever and whatnot' priest can argue his/her way around the simple fact that all of a sudden array methods in FF are much faster than his/her opinionated brainfuck. Man, you just can't cheat your runtime environment by cheating your runtime environment! Think about that when promoting ..
Lodash Tutorial
your utility belt
.. next time.
So to keep it relevant:
- Use Underscore if you're into convenience without sacrificing native ish.
- Use Lo-Dash if you're into convenience and like its extended feature catalogue (deep copy etc.) and if you're in desperate need of instant performance and most importantly don't mind settling for an alternative as soon as native API's outshine opinionated workaurounds. Which is going to happen soon. Period.
- There's even a third solution. DIY! Know your environments. Know about inconsistencies. Read their (John-David's and Jeremy's) code. Don't use this or that without being able to explain why a consistency/compatibility layer is really needed and enhances your workflow or improves the performance of your app. It is very likely that your requirements are satisfied with a simple polyfill that you're perfectly able to write yourself. Both libraries are just plain vanilla with a little bit of sugar. They both just fight over who's serving the sweetest pie. But believe me, in the end both are only cooking with water. There's no Vanilla God so there can't be no Vanilla pope, right?
Choose whatever approach fits your needs the most. As usual. I'd prefer fallbacks on actual implementations over opinionated runtime cheats anytime but even that seems to be a matter of taste nowadays. Stick to quality resources like http://developer.mozilla.com and http://caniuse.com and you'll be just fine.
Lukas BüngerLukas BüngerI'm agree with most of things said here but I just want to point out an argument in favor of underscore.js: the size of the library.
Specially in case you are developing an app or website which intend to be use mostly on mobile devices, the size of the resulting bundle and the effect on the boot or download time may have an important role.
For comparison, these sizes are those I noticed with source-map-explorer after running ionic serve:
David Dal BuscoDavid Dal BuscoNot sure if that is what OP meant, but I came accross this question because I was searching for a list of issues I have to keep in mind when migrating from underscore to lodash.
I would really appreciate if someone posted an article with a complete list of such differences. Let me start with the things I've learned the hard way (that is, things which made my code explode on production:/) :
_.flattenin underscore is deep by default and you have to pass true as second argument to make it shallow. In lodash it is shallow by default and passing true as second argument will make it deep! :)_.lastin underscore accepts a second argument which tells how many elements you want. Inlodashthere is no such option. You can emulate this with.slice_.first(same issue)_.templatein underscore can be used in many ways, one of which is providing the template string and data and gettingHTMLback (or at least that's how it worked some time ago). Inlodashyou receive a function which you should then feed with the data._(something).map(foo)works in underscore, but in lodash I had to rewrite it to_.map(something,foo). Perhaps that was just aTypeScript-issue
Latest article comparing the two by Ben McCormick:
Lo-Dash's API is a superset of Underscore's.
Download Split Second Velocity USA REPACK PSP-pSyPSP ROM / ISO for PSP from Rom Hustler. 100% Fast Download. Split Second Velocity APK + ISO PSP is a Popular Android Game and people want to get it on their android phones and tables for Free. So here is the download link. Split Second Velocity Reloaded pc full iso, Download game pc iso, Repack pc game, Crack game pc, Direct link download game pc, Full iso game. Download split second velocity psp ita. RG Mechanics[Repack] – TORRENT – FREE DOWNLOAD – CRACKED Split/Second: Velocity, is an arcade racing video game Description: Split Second Velocity is a Racing game and published by Disney Interactive Games released on 18 May, 2010 and designed for Microsoft Windows.Players in Split Second velocity don’t just collide. That’s the idea behind Split/Second, an arcade racer in which you wreck your opponents by triggering destructive hot spots scattered all about the track. Tags: download Split Second Velocity PC, download Split Second Velocity PC torrent. PS3, PS4, PSP, PS Vita, Linux, Macintosh, Nintendo Wii, Nintendo Wii U, Nintendo 3DS.
Under the hood [Lo-Dash] has been completely rewritten.
Lo-Dash is definitely not slower than Underscore.
What has Lo-Dash added?
- Usability Improvements
- Extra Functionality
- Performance Gains
- Shorthand syntaxes for chaining
- Custom Builds to only use what you need
- Semantic versioning and 100% code coverage
I just found one difference that ended up being important for me. The non-underscore-compatible version of lodash's _.extend() does not copy over class-level-defined properties or methods.
I've created a Jasmine test in CoffeeScript that demonstrates this:
Fortunately, lodash.underscore.js preserves Underscore's behaviour of copying everything, which for my situation was the desired behaviour.
lodash has got _.mapValues() which is identical to underescore's _.mapObject().
For the most part underscore is subset of lodash. At times, like presently underscore will have cool little functions lodash doesn't have like mapObject. This one saved me a lot of time in the development of my project.
rashadbrashadbThey are pretty similar, with Lodash is taking over..
They both are a utility library which takes the world of utility in JavaScript..
Seems Lodash is getting updated more regularly now, so more used in the latest projects..
Also Lodash seems is lighter by a couple of KBs..

Both have a good api and doc, but I think Lodash one is better..
Here is screenshot for each of the docs for getting the first value of an array..
underscore:
lodash:

As things may get updated time to time, just check their website also..
AlirezaAlirezaNot the answer you're looking for? Browse other questions tagged underscore.jsjavascriptlodash or ask your own question.
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
commented Jun 8, 2015
I'm using npm as my front end package manager, and have been using the /dist/lodash.min.js file for a long time. Is it a bug or a feature? :P |
commented Jun 8, 2015
The file structure of the npm module changed; for now you can access the monolithic build via |
Import Lodash
commented Jun 8, 2015
@d10 but not as a minified file. The files seems to be available in the root of the project on github, so why can't we keep the /lodash.min.js and /lodash.js files around? |
commented Jun 8, 2015
This is by design. There are lots of ways to go about building, bundling, and minifying. If you're using npm as your front end package manager then I'm sure you're familiar with webpack, browserify, and uglify. Use any combo of them to minify your source. |
commented Jun 8, 2015
I'm using gulp to concat my libraries, but I'd rather not minify it, since this can cause problems with settings and such. Most other client side libraries supply both a minified ('compiled') version and a raw debug version. I'm guessing I'm not the only one that is missing the minified versions. |
commented Jun 8, 2015
Jquery Download
Your scenario, taking the npm package and using it for the client side without cherry-picking, isn't one of our primary targets. With the simplicity of minifiers these days it should take you minimal effort to minify or bundle your third-party deps appropriately. |