You can use Object.defineProperty with {enumerable: false}.
> Array.prototype.foo = function() {return 'bar';}
> for (let i in ['a', 'b', 'c']) console.log(i);
0
1
2
foo
> Object.defineProperty(Array.prototype, 'foo', {value: function() {return 'bar';}, enumerable: false})
> for (let i in ['a', 'b', 'c']) console.log(i);
0
1
2