Thursday, June 6, 2013

JavaScript has a strict mode.

This suggests that one may use strict mode in JavaScript by merely using the following in a .js file before any other statements:

"use strict";

 
 

Some of the fun that is strict:

  • You can't reference variables that don't exist. I guess an error will be thrown. (I write this without having used the feature.)
  • breaks in Safari
  • breaks Dojo inheritance

No comments:

Post a Comment