UNPKG

581 BJavaScriptView Raw
1'use strict';
2var $ = require('../internals/export');
3var $filter = require('../internals/array-iteration').filter;
4var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
5
6// `Array.prototype.filter` method
7// https://tc39.github.io/ecma262/#sec-array.prototype.filter
8// with adding support of @@species
9$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
10 filter: function filter(callbackfn /* , thisArg */) {
11 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
12 }
13});