Here you can find the source of even()
Array.prototype.even = function(){ var newArr = []; for (var i of this){ if (i % 2 === 0){ newArr.push(i);//from ww w. ja va 2 s . com } } return newArr; }
Array.prototype.even = function () { return this.filter(function(value) { return value % 2 == 0; });
Array.prototype.even = function () { return this.filter(function (e) { return !(e % 2); }); };
Array.prototype.even = function () { return this.filter((item) => { return item % 2 === 0; }); };
Array.prototype.even = function(){ let even = new Array(); for(const e of this){ if(!isNaN(e) && (e % 2 === 0)) even.push(e); return even; Array.prototype.odd = function(){ ...
Array.prototype.even = function() var ret = new Array(); this.forEach(function(a) { if (0 == a % 2) { ret.push(a); }); return ret; ...
Array.prototype.even = function(){ return this.filter(x=> x%2 == 0?x:'');
Array.prototype.evens = function () { var a = [], o = this; for (var i = 0; i < o.length; i++) { if (i%2!=0) a.push(o[i]); return a; };