Force JavaScript exception/error when reading an undefined object property?

后端 未结 7 1067
后悔当初
后悔当初 2020-11-30 04:29

I\'m an experienced C++/Java programmer working in Javascript for the first time. I\'m using Chrome as the browser.

I\'ve created several Javascript classes with fie

相关标签:
7条回答
  • 2020-11-30 05:26

    Firefox has an option javascript.options.strict (in about:config). If you enable this, warnings will be logged to the console for many common mistakes, including reading an undefined property, using = instead of == in an if, etc.

    (Of course, that's not to say such code is necessarily wrong.)

    0 讨论(0)
提交回复
热议问题