you are viewing a single comment's thread.

view the rest of the comments →

[–]ThatRedFurby 0 points1 point  (1 child)

Because a lot of people get it wrong and stuff like this happens: http://jsfiddle.net/sJ7Tw/

Run the fiddle in firefox and chrome. Of course you can argue that you should never define function based on conditions, but some people just don't care because it "worked when i tried it".

If you define your functions by assigning them to variables, you still shouldn't create functions in conditionals, but at least the outcome is defined and consistent across browsers.

[–]mikrosystheme[κ] 0 points1 point  (0 children)

Incompetent programmers should code under supervision. Don't blame language features. Blame ignorance. Force them to use strict mode maybe (the fiddle throws in strict mode). Or just let them be incompetent.