This won’t pass JSLint in strict mode:
"use strict";
(function (w) {
w.alert(w);
}(window));
The error–from jslint.com–looks like this:
Problem at line 4 character 3: ‘window’ is not defined.
}(window));
Implied global: window 4
Do I need to tell JSLint to ignore the error, or am I seriously doing something wrong?
Try adding the following:
(or check Assume a browser checkbox).
The first line adds general browser support. The second line declares window to be a global variable.
From the documentation: