From 4416a1ed47afe77325d86c6fd573c777fa7f4c5e Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Mon, 7 Jan 2019 12:07:44 +1100 Subject: [PATCH] [docs] add filterBy example --- packages/@ember/-internals/runtime/lib/mixins/array.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/@ember/-internals/runtime/lib/mixins/array.js b/packages/@ember/-internals/runtime/lib/mixins/array.js index 3725044f966..3fb3400d802 100644 --- a/packages/@ember/-internals/runtime/lib/mixins/array.js +++ b/packages/@ember/-internals/runtime/lib/mixins/array.js @@ -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