I'm fairly inexperienced with javascript but I'm trying to create a library for people to use. Supposed I set the function window.onerror to my own function in my own js file but someone else also assigns window.onerror to a function in their code.
If they execute their js code before mine, won't my window.onerror function overwrite theirs? And if they execute their js code after mine, won't the opposite happen? Now, window.onerror is just example but if I were to use jquery in my code for something like $.ajaxComplete that have a global scope, is there a way to accommodate both our methods without knowing the order?