Last active
December 30, 2015 07:29
-
-
Save fonzerelly/7796347 to your computer and use it in GitHub Desktop.
simple example of _.partialRight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var books = [ | |
{ | |
name: "Little Miss Sunshine", | |
numberOfPages: 32 | |
}, | |
{ | |
name: "Mr. Strong", | |
numberOfPages: 36 | |
}, | |
{ | |
name: "Mr. Tickle", | |
numberOfPages: 32 | |
} | |
]; | |
var getNumberOfPages = _.partialRight(_.result, "numberOfPages"); | |
getNumberOfPages(books[1]); | |
// 36 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment