This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In

Autoplay
    This lesson is outdated. Click here to find out about changes you should be aware of.

    Introduction to Lodash

    John LindquistJohn Lindquist

    Lodash is a toolkit of Javascript functions that provides clean, performant methods for manipulating objects and collections. It is a "fork" of the Underscore library and provides additional functionality as well as some serious performance improvements. If you aren't using Lodash, you should be.

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Transcript

    Transcript

    Narrator: 00:00 Lo-Dash is an insanely helpful set of utilities for both for the browser and node. Let's say for example I want to get the first three values out of this set of people. I can just say first three, run it, and I can get the first three people.

    00:14 If I want to sort by their names, I can just say sort by name. You can see now it's sorted by name. If I want it to sort by their age, I can now sort by their age. If I only want to get a new array of just the names and I don't care about the values, I could get that. I could then sort them and get those.

    00:38 If I only wanted to get the people who are of the age of 22, I could say age 22 and return all those people. Again, do something like a sort. Or if I wanted to get the oldest person, I could say max and check the age and get the oldest person. Or if I get the youngest person, let's say min and age, and on and on and on.

    01:02 Lo-Dash does have a ton of features. If you want to read about all of them, go their API documentation at Lo-Dash.com/docs. If you're familiar with other libraries like Underscore, which Lo-Dash came from, or something like Sugar JS. These are all very similar but Lo-Dash has seen the greatest adoption in the community due to its performance and features and other things like that.

    01:26 We'll be doing a lot more videos on Lo-Dash as well as simply using Lo-Dash in videos, because it's such a great library.

    Discuss

    Discuss