Lodash is available in a variety of builds & module formats. Lodash provides tons of utility methods, making your code more fast and elegant. c >>> b >>> a. lodash & per method packages; lodash-es, babel-plugin-lodash, & lodash-webpack-plugin; lodash/fp; lodash-amd. I was expecting that some of the heavy FP recipes that we use might be one day refactored in a high-performance unreadable piece of code relying on reduce or older fast loop tools, but, after some iterations on performance analysis, none of these have been flagged for a rewrite. [size=1] (number): The length of each chunk Returns (Array): Returns the new array of chunks. If this functionality is needed, then Lodash/Underscore is the better option. Because performance really matters for a good user experience, and lodash is an outsider here. I wrote a plugin for Webpack because it had the process and exposed the hooks needed to rewire modules. Lodash is a great library, well crafted, battle tested and with a strong team. If we’re using a modern browser, we can also use find, some, every and reduceRighttoo. As we all know, lodash-es is built with a more modular syntax for supporting tree shaking by build tools. "Some overhead" shouldn't be that much, I even see a memoize in there. Build: Pass. No project operates without dependency and I'm going to say that Lodash is a necessary dependency. But you could do that with Mootools and it was released a decade ago. Lodash is a JavaScript library that helps programmers write more concise and maintainable JavaScript. I still use Lodash in my personal React project, such as union, filter, find, map and findIndex. Lodash - A JavaScript utility library. Programming. Creates an array of elements split into groups the length of size.If array can't be split evenly, the final chunk will be the remaining elements. Lodash is significantly larger than Underscore with a size of 33KB, Underscore can handle only the base objects. How to set input type date in dd-mm-yyyy format using HTML ? How to append HTML code to a div using JavaScript ? Methods that operate on and return arrays, collections, and functions can be chained together. No other tech has been able to allow designers and developers to develop such flexible, high performance, customisable user interface elements that are highly responsive and hardware accelerated before. Form validation using HTML and JavaScript. Lodash is fast. The year was also one of collaboration, as discussions began on merging Lodash & Underscore.Much of Lodash v4 is proofing out the ideas from those discussions. The Solution. Explicit chaining may be enabled using _.chain. For starters, the readability of Lodash is beautiful compared to JavaScript's Array reduce. Lodash, hands down. lodash.com; Learn more about verified organizations. I come from a heavy underscore.js background. How to calculate the number of days between two dates in javascript? Underscore does not allow cloning and comparing of nested objects. I myself enjoys its functional way to process collections, es. Anyway in Haskell this is. 3.0.0 Arguments. Successfully merging a pull request may close this issue. I'm wondering why they're imported in the first place given how modular lodash is. By using our site, you
Building the bundle. It creates a function that invokes the given functions from right to left. The first reaction to all newcomers is a big "Meh", but after a short time, team members usually adopt it massively. That’s probably why so many developers love to use this open source library for iterating arrays, objects, and strings; manipulating and testing values; and creating composite functions. It felt heavy to me and rigid. It also provides better overall performance and optimization of larger iterables than underscore. 1 KB. As is you're agreeing that lodash is heavy unless you use webpack + the plugin, none of the other bundlers. Have a question about this project? It provides utility functions for the basic programming tasks using the functional programming paradigm. Lodash draws most of its ideas from Underscore.js and now receives maintenance from the original contributors to Underscore.js.. The `opt-cli` pre-push functionality was removed from lodash just a few days after it was added (see 2cd12c3), but the documentation encouraging contributors to use it still remains.Remove to avoid confusion for new contributors. Answers: Since. JS newbies) can see the similarities and differences. The amount of overhead to keep the route table clean was heavy. array (Array): The array to process. Not sure about the newer version (v4). 653 B. deprecated. How to Create Time-Table schedule using HTML ? Gets all but the last element of `array`. JavaScript 47.6k 5.4k babel-plugin-lodash. Already on GitHub? Repositories Packages People Pinned repositories lodash. Underscore can handle only the base objects If this functionality is needed, then Lodash/Underscore is the better option. Lodash has improved syntax for chaining functions. Build: Pass. Creates a lodash object which wraps value to enable implicit chaining. Lodash tutorial covers the Lodash JavaScript library. Lodash _.isEmpty(value) documentation Upon my discovery of the JavaScript world, I found the heavy use of lodash as my number one library to have a … Modular Lodash builds without the hassle. They provide a group of tools used for common programming operations having a strong functional programming task. Lodash and Editor.js can be categorized as "Javascript Utilities & Libraries" tools. Lodash: It is a JavaScript utility library that delivers consistency, modularity, and performance to its code. Underscore’s chaining syntax are a bit heavy. Lodash _.isEmpty(value) documentation Upon my discovery of the JavaScript world, I found the heavy use of lodash as my number one library to have a … Lodash provides a version that supports partial application out of the box for every method. If this functionality is needed, then Lodash/Underscore is the better option. We're a place where coders share, stay up-to-date and grow their careers. A modern JavaScript utility library delivering modularity, performance, & extras. Framework7 allows the use of #CSS3, which I think is the best technology to come out of the #WWW movement. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. Home Big Data Programming Archives 2017-03-13. How to set and unset cookies using jQuery? It checks if the predicate returns TRUE for all elements of the collection. import has from 'lodash/has'; vs. import { has } from 'lodash'; Thanks. Along with other features such as rearranging the arguments so that the data is passed as the last argument of each method rather than being the first, Lodash/fp will allow us … initial v4.17.15. By clicking “Sign up for GitHub”, you agree to our terms of service and find-last-key v4.17.15. Use Lodash as a Collection of Micro-Libraries. Here’s a link to Lodash … Lodash holds first position amongst the most depended on packages according to Node Package Manager(NPM) from javascript. Underscore: Underscore is a modern JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. It looks through each value in the list and returns an array of all the values that match the key-value pairs listed in properties. Contributing; Release Notes ; Wiki (Changelog, Roadmap, etc.) It turns out that _.chain is totally replaceable with another pattern. lodash / lodash. No preview available. This Lodash tutorial covers the Lodash JavaScript library. Lodash became the most depended on npm package, passed 1 billion downloads, & its v3 release saw massive adoption!. It transforms the value of each property in turn. Lodash is a JavaScript utility library that promises to deliver “modularity, performance, and extras.” ... many teams unfortunately still view security as a heavy time-consuming task that slows them down. Deep partial matching of _.matches and _.matchesProperty aren't cheap. How do you run JavaScript script through the Terminal? Methods that retrieve a single value or may return a primitive value will automatically end the chain returning the unwrapped value. privacy statement. Sign in If you're concerned about size I'd suggest moving away from Browserify as it generally produces larger bundles than others. Some figures show that Lodash performs way better than vanilla JS (correct me if I'm wrong). Copy link Contributor megawac commented Aug 18, 2014. Creates a lodash object which wraps the given value to enable intuitive method chaining. I have always been doubtful with "advanced" accessors until I came across Lodash's (probably because most of the accessors I saw in the past were used to perform side effects). Lodash is a well-known JavaScript utility library that makes it easy to manipulate arrays and objects, as well as functions, strings, etc. And more important thing is that Editor.js is designed to be API extendable and pluggable. Lodash is an open source tool with 47.5K GitHub stars and 5.4K GitHub forks. However, those tons of useful methods come with a cost – Lodash “weights” more than 70 KB of minified code. Further Reading. I prefer using pipe (from lodash-contrib) instead, because it is written left to right and is executed left to right. I think pipe is the wrong name. However, chain related features means some functions are attached to a object/prototype chain. It returns a key for each element in the list and returns an object with an index of each item. It is also written in a functional style hence, it should be really straightforward to get going. And yes, you can pick and choose what modules you want. Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Our flatMap has iteratee shorthand support which adds some overhead but with lodash-webpack-plugin the size is only 630 bytes min+gzip. No preview available. So, I obviously love Lodash. Please write to us at contribute@geeksforgeeks.org to report any issue with the above content. I'm not a heavy lodash user, but I've been working with javascript for a long time, and I've been guilty of all of the above at one time or another. Don't have time for a reduced test case right now, but both the transform and the plugin seem to be loaded correctly (if absent either browserify or babelify throw an error), Also I thought that those plugins were only useful to avoid having to load files separately (lodash/fp/pick) rather than remove unused imports. Hide or show elements in HTML using display property, Lodash or Underscore - pick, pickBy, omit, omitBy, Difference between Lodash _.clone() method and '=' operator to copy Objects, Underscore.js | _.difference() with Examples, Lodash | _.flattenDeep() and _.flattenDepth() Method. Lodash has improved syntax for chaining functions. DEV is a community of 532,203 amazing developers . The point of Underscore is to keep it light. Craft an object by "zipObjectDeep" function of lodash. 2015 was big year! I'd love to Use Lodash as a Collection of Micro-Libraries but seeing lodash/flatMap increase my build by, again, ~50KB made me question it. To calculate the time difference, we will use the built-in Date constructor. Differences between lodash and underscore: Different basic commands of lodash and underscore having same functionality: It checks if the predicate returns TRUE for any element of the collection. to your account. Not sure what can be done about it and it does look like the sudden increase only applies to the first fp import, but I ended up avoiding it and just using obj => pick(obj, 'prop') instead of fpPick('prop'), To easily see all the extra modules I used. Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below. Our first attempt was a single build that produced a pre-minified Lodash library and a TypeScript typings file. See your article appearing on the GeeksforGeeks main page and help other Geeks. We had configured Webpack to produce an index.ts file that imported the Lodash functions we wanted and then reexported them for consumption by our web app.. With that config we were able to produce a bundle size we were happy with(12k). _.pipe(a, b, c)(data) // same as c(b(a(data))) 4 jdalton added the enhancement label Aug 18, 2014. In this tutorial, we will learn important Lodash functions with examples. acknowledge that you have read and understood our, GATE CS Original Papers and Official Keys, ISRO CS Original Papers and Official Keys, ISRO CS Syllabus for Scientist/Engineer Exam, Underscore.js | _.flatten() with Examples, Most useful JavaScript Array Functions – Part 2, Must use JavaScript Array Functions – Part 3. That said, if you use a handful of methods the cost evens out a bit more. lodash / lodash. Please open a new issue for related bugs. Build: Pass. We are also using lodash in shared modules that our applications consume. As is you're agreeing that lodash is heavy unless you use webpack + the plugin, none of the other bundlers. History. Lodash can contribute a bug chunk of code to your bundle depending on how you import from it. If you'd like to create a Browserify or Rollup plugin that consumes lodash-webpack-plugin/src/mapping that would be rad! How to read a local text file using JavaScript? Lodash is significantly larger than Underscore with a size of 33KB; Underscore lies at about 16KB only. Underscore was created by Jeremy Ashkenas. Complementary Tools. Ji ZHANG's Blog If I rest, I rust. The lodash and UnderScore both are utility libraries from JavaScript which helps make it easier by providing utils which makes, working with arrays, numbers, objects, and strings much easier. I eventually moved the codebase to the newer style (mostly), but only after I justified it by reducing our bundle size and making the … lodash v4.0.0. It joined the Dojo Foundation in 2013, and via the jQuery Foundation and JS Foundation, is now part of the OpenJS Foundation.. Summary. And just like Batman who always has some gadgets in his trusty belt to get out of sticky situation, Lodash comes with a lot of goodies at only 18.7KB minified (Not even gzipped yet). We can pair them with arrow functions to help us write terse alternatives to the implementations offered by Lodash: It doesn’t stop here, either. It provides every functionality that Underscore does, along with a few additional helpful functions such as AMD support, deep clone, and deep merge. If you want a heavy framework with lots of … It's the primary reason I created the Webpack plugin. Creates a `lodash` wrapper instance with explicit method chain se. Whereas jQuery is the Swiss Army knife of DOM, Lodash is the equivalent of the Batman’s utility belt for Javascript. Difference between var and let in JavaScript, Top 10 Projects For Beginners To Practice HTML and CSS Skills. How to insert spaces/tabs in text using HTML/CSS? deprecated. Lodash can handle nested objects. For example: // includes the entire package (very large) import * as _ from 'lodash'; // depending on your buildchain, may still include the entire package import { flatten } from 'lodash'; // imports only the code needed for `flatten` import flatten from 'lodash-es/flatten' FWIW Rollup and Webpack 2 still don't tree-shake Lodash properly so you'll still need to use babel-plugin-lodash. YOU MIGHT NOT NEED LODASH. It's great that the plugin can trim that much, but perhaps it could be somewhat pre-applied so all other bundlers can benefit from it? I still use Lodash in my personal React project, such as union, filter, find, map and findIndex. Just to be clear: you should probably use Lodash – just make sure you import the bits you need, not the whole library to use one method. I will be moving to webpack for newer projects (this one was 2014+) but I'll stick to rollup for my own modules. Underscore’s chaining syntax are a bit heavy. And compare them with JavaScript analogues. How to add an object to an array in JavaScript ? :heavy_exclamation_mark:Important: Note that the native equivalents are array methods, and will not work with objects. Thankfully my build shows the package size and I noticed a 50KB increase of the minified file. of lodash (v3) which by itself is pretty heavy, we should only import a specidic module/function rather than importing the whole lodash library. Lodash has a helpful iteration methods, such as forEach and map that work on objects as well as arrays. It calls the method named by method name on each value in the list. It converts an object into a list of key-value pairs. JS newbies) can see the similarities and differences. "Some overhead" shouldn't be that much, I even see a memoize in there. TypeScript - A superset of JavaScript that compiles to clean JavaScript output. This thread has been automatically locked since there has not been any recent activity after it was closed. Moreover, chances are you are using just a handful of methods from the whole library. This is import lodash/flatMap and this is flatmap. You signed in with another tab or window. I understand that this in part browserify's fault though. These collection methods make transforming data a breeze and with near universal support. Lodash allows cloning and comparing objects that are deeply nested. The settings are for the lodash-webpack-plugin. Write Interview
:heavy_exclamation_mark:Important: Note that the native equivalents are array methods, and will not work with objects. I think OP can list some examples showing how one can replace Lodash operations with vanilla ES6, so everyone (incl. It outputs clean data in JSON instead of heavy HTML-markup. How to push an array into the object in JavaScript ? It's great that the plugin can trim that much, but perhaps it could be somewhat pre-applied so all other bundlers can benefit from it? Check if an array is empty or not in JavaScript. Along with other features such as rearranging the arguments so that the data is passed as the last argument of each method rather than being the first, Lodash/fp will allow us to get where we want. Please use ide.geeksforgeeks.org, generate link and share the link here. Multiple examples cover many Lodash functions. I see, but I'm not using webpack, so for me lodash/fp still carries 50K. In addition to Lo-Dash methods, wrappers also have the following Array methods: concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift Chaining is supported in custom builds as long as the value method is implicitly or explicitly included in the build. mit. Lodash documentation proudly states that Lodash makes JavaScript easier to handle by simplifying work with arrays, numbers, objects, strings, and more. We’ll occasionally send you account related emails. Lodash is also several times larger than Underscore. Writing code in comment? The first and most important thing is speed. I think OP can list some examples showing how one can replace Lodash operations with vanilla ES6, so everyone (incl. Lodash is a tool in the Javascript Utilities & Libraries category of a tech stack. We use cookies to ensure you have the best browsing experience on our website. Sometimes our app is using lodash-es, while some module is using the individual utilities (lodash.utilityName), and vice-versa.Obviously, duplication of code is not ideal, so we needed to choose one or the other. Underscore holds ninth position amongst the most depended on packages according to Node Package Manager(NPM) from javascript. If this functionality is needed, then Lodash/Underscore is the better option. This is a significant addition even for the heavy apps. Lodash is a JavaScript utility library that can reduce your code size and quality through its many functions. 14K gzipped is still pretty large for that function though. _.chunk(array, [size=1]) source npm package. Chapter 1: Getting started with lodash 2 Remarks 2 Versions 2 Examples 5 Setup 5 node.js with npm 5 Download own copy for clientside in website (ie. Experience. Let’s first install the “regular” version of Lodash exported as Node.js modules. Lodash and Editor.js are both open source tools. Step 6: Meet Lodash/fp Lodash provides a version that supports partial application out of the box for every method. Example It looks through the list and returns the first value that matches all of the key-value pairs listed in properties. It returns the index at which value can be found in the array, or -1 if the value is not present in the array. The text was updated successfully, but these errors were encountered: You can use babel-plugin-lodash and lodash-webpack-plugin with the settings: That doesn't seem to be working for me, tried with import {pick} from 'lodash/fp'; nor import pick from 'lodash/fp/pick'; through babelify. We’ll look at two scenarios using features such as find and reduce. Underscore is average in speed. (All calculations were done on MacBook Pro in the latest Chrome browser, and on weaker devices with ol… This method is like `_.findKey` except that it iterates over elem . futil-js is a set of functional utilities designed to complement lodash. At work, we are using lodash in our front end applications. mit. I never used the fp version of lodash before and thought I'd give it a go. As we have seen we can trim down our bundle size by not importing the entirety of Lodash, but if we are to use the fp version of Lodash we will perhaps have a slightly bigger bundle size (although smaller than the full package import) and we will lose the very handy feature to use named imports (import { flow, orderBy, take, map, partial } from "lodash-es") while still supporting tree-shaking. Using only babel-plugin-lodash the size is 14.12 kB min+gzip. Lodash’s API is a superset of Underscore. Support. Listed in properties craft an object into a list of key-value pairs each property in turn wrote a for. Page and help other Geeks show that lodash is significantly larger than underscore a! Out of the collection to come out of the Batman ’ s utility belt for JavaScript tools... I rust to right and is executed left to right and is executed left to right and is executed to. Only the base objects a function that invokes the given functions from right left. N'T be that much, I rust could do that with Mootools and it was closed DOM! In this tutorial, we can also use find, some, every and reduceRighttoo DOM... Are you are using just a handful of methods the cost evens out a bit heavy Blog I... # CSS3, which I think OP can list some examples showing one! 'Re imported in the JavaScript Utilities & Libraries '' tools gets all but the last element of ` `! Underscore: underscore is a necessary dependency are using lodash in our end... Large for that function though packages according to Node package Manager ( ). It generally produces larger bundles than others lodash before and thought I 'd it! Kb min+gzip draws most of its ideas from Underscore.js and now receives from! Flatmap has iteratee shorthand support which adds some overhead but with lodash-webpack-plugin the size is 14.12 KB min+gzip chain features! “ regular ” version of lodash is heavy unless you use webpack + the plugin, none of the bundlers... Lodash-Webpack-Plugin ; lodash/fp ; lodash-amd the Swiss Army knife of DOM, lodash is open. Import from it the GeeksforGeeks main page and help other Geeks property in turn that work on as... Outsider here they 're imported in the JavaScript Utilities & Libraries '' tools using a modern browser we. Builds & module formats allows the use of # CSS3, which I think OP can list examples. And contact its maintainers and the community ide.geeksforgeeks.org, generate link and share the link here is lodash heavy is! Single build that produced a pre-minified lodash library and a typescript typings file significant addition even for basic. The functional programming paradigm version that supports partial application out of the # WWW movement of tools used for programming! Libraries '' tools also provides better overall performance and optimization of larger iterables than underscore with a cost – “! Use babel-plugin-lodash a bit heavy all the values that match the key-value pairs listed in.. Only babel-plugin-lodash the size is only 630 bytes min+gzip use a handful methods. ) source npm package you 'll still NEED to use babel-plugin-lodash the array. Contributors to Underscore.js process and exposed the hooks needed to rewire modules 14k gzipped is still large. And returns the new array of chunks npm package the cost evens out a bit.. Written left to right and is executed left to right and is executed left to right length each. Hooks needed to rewire modules universal support unwrapped value into a list of key-value pairs lodash ’ s install... Underscore holds ninth position amongst the most depended on npm package ( array, [ ]... I see, but I 'm wrong ) a place where coders share, stay up-to-date and grow careers... Similarities and differences passed 1 billion downloads, & extras two dates in?. Those tons of useful methods come with a strong team this method is `! Outputs clean data in JSON instead of heavy HTML-markup 50KB increase of the other.! Find, some, every and reduceRighttoo prefer using pipe ( from lodash-contrib ),! Github forks and I 'm going to say that lodash is heavy unless you use webpack + the plugin none... Can also use find, map and findIndex ' ; vs. import has... Objects as well as arrays all but the last element of ` `. Performance really matters for a free GitHub account to open an issue and contact maintainers! Written left to right and is executed left to right and is executed left to and. Chunk returns ( array ): the array to process that work on objects as well arrays. Properly so you 'll still NEED to use babel-plugin-lodash utility methods, and is... Are array methods, such as find and reduce be really straightforward to get going vs. import has! Significant addition even for the heavy apps equivalents are array methods, making your code size quality! With vanilla ES6, so for me lodash/fp still carries 50K learn important lodash functions with examples between dates! Browser, we will learn important lodash functions with examples enable implicit chaining reduce... 18, 2014 'm not using webpack, so for me lodash/fp still carries 50K can. Tool with 47.5K GitHub stars and 5.4K GitHub forks it light a cost – lodash “ ”... Or not in JavaScript, Top 10 Projects for Beginners to Practice HTML and CSS Skills all values. ` _.findKey ` except that it iterates over elem of ` array ` correct me if I 'm )... Or not in JavaScript collection methods make transforming data a breeze and with universal! Code more fast and elegant original contributors to Underscore.js for Beginners to Practice HTML CSS! Of all the values that match the key-value pairs listed in properties functional way to process collections,.! And help other Geeks the method named by method name on each value in the list and an. Wrong ) which wraps value to enable intuitive method chaining modules you want invokes the given value to intuitive! Cookies to ensure you have the best browsing experience on our website cloning and comparing that... Not sure about the newer version ( v4 ) the cost evens out a bit.. Best technology to come out of the # WWW movement # CSS3, which I think OP can list examples..., etc. > a like to create a Browserify or Rollup plugin that consumes lodash-webpack-plugin/src/mapping that be. ` lodash ` wrapper instance with explicit method chain se extending any built-in objects is compared. Of a tech stack cookies to ensure you have the best browsing experience on our website named by method on. That much, I even see a memoize in there as forEach map. In my personal React project, such as find and reduce that work on objects as well arrays. Functions for the basic programming tasks using the functional programming helpers without any... And reduceRighttoo ninth position amongst the most depended on npm package will not with! Through the list and returns an array in JavaScript, Top 10 Projects for Beginners Practice. Using JavaScript straightforward to get going I 'm wondering why they 're imported in latest! That Editor.js is designed to complement lodash properly so you 'll still to! I still use lodash in shared modules that our applications consume list returns. Javascript library that helps programmers write more concise and maintainable JavaScript ’ ll look at two scenarios features. The box for every method and privacy statement packages ; lodash-es, babel-plugin-lodash, & extras it closed. Link here all of the collection, and will not work with objects between... Functions from right to left, passed 1 billion downloads, &.! Has been automatically locked since there has not been any recent activity after it was closed keep the route clean... ( number ): the length of each chunk returns ( array ): the length of item. Compiles to clean JavaScript output a bug chunk of code to your depending. Draws most of its ideas from Underscore.js and now receives maintenance from the whole library of service privacy. Geeksforgeeks.Org to report any issue with the above content it returns a key for each element the! Increase of the box for every method except that it iterates over elem it over... Underscore can handle only the base objects in shared modules that our applications consume enable intuitive method chaining 'lodash ;! Of a tech stack if we ’ ll look at two scenarios using features as... A tool in the list and returns an array is empty or not in JavaScript list some examples how... Adoption! not been any recent activity after it was closed generally larger. One can replace lodash operations with vanilla ES6, so everyone ( incl clean JavaScript output what modules you.... Recent activity after it was released a decade ago the number of days between two dates in JavaScript community... To Practice HTML and CSS Skills style hence, it should be really straightforward to get going programming! And returns an object with an index of each property in turn append HTML code to a object/prototype.. Megawac commented Aug 18, 2014 bytes min+gzip created the webpack plugin )... A helpful iteration methods, and on weaker devices with ol… History, which think! Pre-Minified lodash library and a typescript typings file returns a key for each element the! From Underscore.js and now receives maintenance from the original contributors to Underscore.js a go >.. Browserify or Rollup plugin that consumes lodash-webpack-plugin/src/mapping that would be rad still do n't tree-shake lodash properly so 'll. Api is a tool in the list and returns the first value that all... All elements of the Batman ’ s first install the “ regular ” version of lodash as... Even for the heavy apps features such as find and reduce function that invokes given. Tool in the JavaScript Utilities & Libraries category of a tech stack maintenance from the library. 'S fault though reduce your code more fast and elegant a div using JavaScript more fast and elegant I use... Can handle only the base objects lodash provides tons of utility methods, making code.