Can someone give me an explanation of the following line:
Assuming a function like:
What does this line mean:
ev = ev || window.event;
A lot of code snippets I see have an event variable as an argument to some event-based function, like mouseUp, mouseMove, or whatever. But the event variable is never actually passed to the function - it's simply stated as an argument to the function, so essentially that means it would be undefined.
So, what does ev = ev || window.event mean? It seems like this line tries to set ev to its own value, which is undefined, or to the value of window.event. What does this line achieve?