Skip to content

Tag: underscore.js

Find by key deep in a nested array

Let’s say I have an object: I want to find the one object where the id is 1. Is there a function for something like this? I could use Underscore’s _.filter method, but I would have to start at the top and filter down. Answer Recursion is your friend. I updated the function to account for property …