Skip to content

Commit

Permalink
Merge pull request #17917 from emberjs/rimian-patch-3
Browse files Browse the repository at this point in the history
[docs] add filterBy example
  • Loading branch information
locks authored Apr 14, 2019
2 parents 2725507 + 4416a1e commit 887f680
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/@ember/-internals/runtime/lib/mixins/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,13 @@ const ArrayMixin = Mixin.create(Enumerable, {
Returns an array with just the items with the matched property. You
can pass an optional second argument with the target value. Otherwise
this will match any property that evaluates to `true`.
Example Usage:
```javascript
const things = Ember.A().addObjects([{food: 'apple'}, {food: 'beans'}]);
things.filterBy('food', 'beans'); // [{food: 'beans'}]
```
@method filterBy
@param {String} key the property to test
Expand Down

0 comments on commit 887f680

Please sign in to comment.