0

Is 'prop in obj' supported by all common browsers: IE6+, Chrome, Firefox, Opera, Safari?

If so, why would jslint.com throw this error:

Unexpected 'in'. Compare with undefined, or use the hasOwnProperty method instead.

      var isClosable = 'close' in iAttrs;

Or is it considered a bad practice?

  • Related: http://stackoverflow.com/questions/7174748/javascript-object-detection-dot-syntax-versus-in-keyword – Uooo May 07 '13 at 06:06
  • 1
    Douglas Crockford (creator of JSLint) just considers using `in` a bad practice - it is supported by all commonly-used browsers. And no, Crockford is **not** God. – Qantas 94 Heavy May 07 '13 at 06:08

0 Answers0