1

I am trying to filter two-dimensional array like var arr = [ [object, object], [object, object], [object, object] ] and return the same structure. Any ideas?

1
  • 1
    Filter by what? Filter in which dimension? Commented Mar 20, 2014 at 20:14

1 Answer 1

1

A combination of filter and map will do it:

_.map(arr, function(subarr) {
    return _.filter(subarr, itemcondition)
})
// or:
_.map(arr, _.partial(_.filter, _, itemcondition));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.