Hacker News new | ask | show | jobs
by cogman10 1486 days ago
Adding methods to prototypes is effectively free. The only time mutating a builtin prototype has negative consequences is when you replace a builtin function with your own thing. All javascript engines (that I'm aware of) JIT at the method level so there's not really a performance impact modifying a prototype.
1 comments

Ah, I think this is what I was thinking of: https://developer.mozilla.org/en-US/docs/Web/JavaScript/The_...

It seems this only pertains specifically to overwriting the __proto__ of an existing object (the is the prototype of other things).