Is There Something Wrong With Extending Native Javascript Prototypes?
I have seen some people regard extending the natives prototypes in Javascript with disdain. I was thinking about doing it, because of syntactic convenience. I.e. function(array, el
Solution 1:
It can conflict with other libraries trying to do the same.
It can conflict with future methods added to native objects.
If anyone is using for (var i in array)
without proper hasOwnProperty()
checks, their code may/probably will break because the new method may show up in the iteration in older browsers.
Post a Comment for "Is There Something Wrong With Extending Native Javascript Prototypes?"