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.)