Profile cover photo
Profile photo
Andrea Giammarchi
439 followers
439 followers
About
Andrea's posts

has `Symbol` been discussed already? It does not allow `new` by specs, so JSLint keeps complaining that `Symbol('label')` is not OK due missing `new` instantiation. I'm not sure I'm missing a flag in the online tool. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Symbol

I am having hard-time understanding why I cannot write code for both node and browsers able to pass JSLint validation.

/*jslint browser: true, node: true */
if (typeof window === 'undefined') {
  global.test = 'fail';
}

regardless how useless that is, the "compare against undefined" is the most annoying and disturbing message I could read.

If a variable is not defined you cannot compare it ... if you don't have access to the root you cannot use `window.property === undefined` 'cause to know window is there you kinda *have to* use `typeof`

What am I missing exactly? I don't mind `typeof document` once I can `typeof window` but not even "enable stupidity" helps here.

Thanks

Post has attachment
Wait while more posts are being loaded