Reading about ECMAScript 5’s strict mode I learn that:
Certain language functions are so pervasive that performing runtime
checks has considerable performance cost. A few strict mode tweaks,
plus requiring that user-submitted JavaScript be strict mode code and
that it be invoked in a certain manner, substantially reduce the need
for those runtime checks.
Some of those tweaks could be:
- Never use
null/undefinedas first argument in acall/applymethod. - Do not create new globals variables inside a function.
Questions:
-
Are there some JavaScript frameworks written in strict mode? So we can trust that our “strict” code will not be wasted?
-
Should I start paying attention to
strict modeno matter what? I mean is it blindly adopted as a good practice?
Yes, most of the frameworks already started to use strict mode. Maybe not complete yet but in the close distance. John Resig:
It is recommended to use, but not required. If you start to use strict mode now, you will get used to it and therefore you will be ready for the new standard.
More aboute strict mode: