Extending prototypes in this way is dangerous and should be done with great care. Don't forget, you are extending a core part of JS that is relied on by pretty much everything else. There's no guarantee that your code will not conflict with other code that attempts to do something similar, or will be compatible with future updates of JS itself.
That said, there are ways to do this kind of thing safely. I recently wrote a library that can be used to help you safely extend native prototypes in this manner. I call it Metho. Take a look if you're interested 🙂
Extending prototypes in this way is dangerous and should be done with great care. Don't forget, you are extending a core part of JS that is relied on by pretty much everything else. There's no guarantee that your code will not conflict with other code that attempts to do something similar, or will be compatible with future updates of JS itself.
That said, there are ways to do this kind of thing safely. I recently wrote a library that can be used to help you safely extend native prototypes in this manner. I call it Metho. Take a look if you're interested 🙂
Hey @jonrandy metho seems really cool. I write an article about it soon