var arr = [NaN,1,21,32,NaN,41,5];
Array.prototype.delNaN = function () {
var arr = [];
for (var i = 0; i < this.length; i++) {
if (this[i] === this[i]) {
arr.push(this[i]);
}
}
return arr;
};
console.log(arr.delNaN())
网友评论