I added this code:
Date.prototype.formatMMDDYYYY = function () {
return (this.getMonth() + 1) +
"/" + this.getDate() +
"/" + this.getFullYear();
}
Resharper's code inspection tool tells me that Extending prototype of native object 'Date' may cause unexpected effects
.
What are some of the unexpected effects that might happen?
P.S. This question has a discussion why it's a bad idea to extend objects in general, but all the answers are very vague. I am looking for a specific side effect of me extending the Date object in the manner that I did.