filter
can.List.prototype.filter
Filter the elements of a List, returning a new List instance with just filtered items.
list.filter(filterFunc, context)
Parameters
-
filterFunc
{function(item, index, list)}
A function to call with each element of the list. Returning
false
will remove the index. -
context
{Object}
The object to use as
this
inside the callback.
A filter function that accepts a function, which is run on every element of the list. If the filter callback returns true, the list returned will contain this item, false and it will not.
Returns a new can.List instance.