instance method Array#filter
Array#filter(iterator[, context]) → Array
-
iterator(Function) – An iterator function to use to test the elements. -
context(Object) – An optional object to use asthiswithin calls to the iterator.
Returns a new array containing all the items in this array for which
iterator returned a truthy value.
Array#filter acts as an ECMAScript 5 polyfill.
It is only defined if not already present in the user's browser, and it
is meant to behave like the native version as much as possible. Consult
the ES5 specification for more
information.