Join Joe Marini for an in-depth discussion in this video Using function features, part of Learning Underscore.js.
Underscore also provides some really nice features for working with functions.…And I guess you could call this functions for working with functions.…And that sounds a little bit weird, but we'll see what I mean in just a moment.…So, I've scrolled down to my function section here…in my snippets, and I'm going to open up functions_start.…And this is where I'm going to build the finished example.…So let's go back to the snippets.…All…right.…The first thing I'm going to do is…use a Underscore feature called the underscore.once function.…
And I'm going to do that to create a…function that can't be called more than one time.…And I don't know about you, but I have bitten by…this bug more than once in my life where I have…a function that does some kind of initialization, and unbeknownst to…me somewhere in my code, I'm calling it more than once and…it turns out that's a bad thing.…So what I'm going to do is copy those lines and paste them in.…And then back over here in the snippets.…I'm going to pass my function here, I'm going to copy the do initialize function.…
- Understanding what Underscore.js is and does
- Installing Underscore.js
- Sorting, grouping, and filtering data sets
- Extracting information about arrays and objects
- Using templates to format data