Join Joe Marini for an in-depth discussion in this video Object operations, part of Learning Underscore.js.
Okay, let's finish up by taking a look at some of…the operations that you can perform on objects, using the _library.…And you can see here in the snippets,…I've scrolled down to the object operations section…and we're going to open up the ops_start…file and this is where we'll exercise the functions.…Let's begin by using the extend function.…So we're going to copy these lines right here and we'll paste them in and…I'll describe what's going on.…So down here in the event handler for the load function, we'll paste, alright?…The extend function is really useful…for adding new properties, to existing objects.…
So in this case, we have a list of students and…let's go ahead and open the sample data, so we can look.…You notice that the sample students have their names and…their midterms and final scores, but they don't have…a property, that represents what their overall grade was.…And their overall grade, let's say for the sake of…argument, is the average of the midterm and the final.…So you add the midterm to the final, you…
- 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