I have seen some examples like this
(function($, window, undefined) {
...
// Do awesome stuff
...
})(jQuery, this);
I understand passing jQuery as a paramter and receiving as $.
This is done to avoid conflict between jquery's $ and any global variable $ ( defined by mistake or by some third party library ).
Why do people pass this
and receive as window
and also receive undefined
in function parameter ?
Is there any way we can override window and undefined ?
PS: I have already tried this in Chrome
undefined = 2; // 2
undefined == 2; // false
It proves undefined can not be over-ridden.