JSLint is not passing this as a valid code:
/* global someVar: false */ if (typeof someVar === "undefined") { var someVar = "hi!"; }
What is the correct way?
/*global window */ if (window.someVar === undefined) { window.someVar = 123456; } if (!window.hasOwnProperty('someVar')) { window.someVar = 123456; }
1.4m articles
1.4m replys
5 comments
57.0k users