Skip to content

Instantly share code, notes, and snippets.

@minedun6
Created September 23, 2018 07:08
Show Gist options
  • Save minedun6/b56301003595d9f0a76d2099741dc442 to your computer and use it in GitHub Desktop.
Save minedun6/b56301003595d9f0a76d2099741dc442 to your computer and use it in GitHub Desktop.
Remember, chaining is a thing in lodash. Just tag a .value() on the end
function getAllActivePostsIds(postsIds) {
return _(posts)
.filter(post => post.is_active)
.map('id')
.value()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment