let arr = ['aa',11,22,'ww','ee']; let obj ={ name:'tomy', age:'16' } Array.prototype.each = function(fn,obj){ console.log(this); let _this = this, len = this.length } arr.each((item)=>{ console.log(item); },obj)