Enumerable#reject()

reject (callback, target) Arraypublic

Defined in packages/ember-runtime/lib/mixins/enumerable.js:415

Returns an array with all of the items in the enumeration where the passed function returns false. This method is the inverse of filter().

The callback method you provide should have the following signature (all parameters are optional):

function(item, index, enumerable);
  • item is the current item in the iteration.
  • index is the current index in the iteration
  • enumerable is the enumerable object itself.

It should return a falsey value to include the item in the results.

Note that in addition to a callback, you can also pass an optional target object that will be set as "this" on the context. This is a good way to give your iterator function access to the current object.

Parameters:

callback Function
The callback to execute
target [Object]
The target object to use

Returns:

Array
A rejected array.
doc_EmberJs
2016-11-30 16:52:01
Comments
Leave a Comment

Please login to continue.