You must tell jshint which object and / or functions are considered global in the jshint tag comment at the top of the code. jsHint does not imply any changes, as they depend on the particular environment in which the code is executed.
The approach I'm using is to tell jshint that the window object itself is global (and several others) with the following, as well as the ES5 strict mode directive:
"use strict";
Having blocked the warning about setInterval , then the prefix of calling this function with the window. is required window. - I like to explicitly specify the global functions that I use, so I do not consider this a drawback.
source share