What's the best method to check if the protoype of a method has been changed?
4
votes
1 Answers
3
votes
It depends on what you mean by "changed" if you mean changed between when your code gets loaded and some later time, you can just store a reference to the function, a la
var oldFunc = SomeType.prototype.someFunction;
...
if (oldFunc === someInstance.someFunction) // unchanged, note the use of strict equality
But if you mean changed from the default native implementation there's no real way to tell.