一、Array.prototype.filter()
Array.prototype.filter = function(callback, thisArg) {
if(this == undefined) {
throw new TypeError('this is null or not underfined');
}
if(typeof callback !== 'function'){
throw new TypeError(callback + 'is not a function');
}
const res = [];
// 让 0 成为回调函数的对象传递(强制转换对象)
const 0 = Object(this);
// >>> 0 保证 len 为 number , 且为正整数
const len = o.length >>> 0;
for(let i = 0; i < len; i++){
// 检查i 是否在 0 的属性 (会检查原型链)
if(i in o){
// 回调函数调用传参