javascript - Enforcing strict mode retroactively -


i'd enforce function level strict mode (i.e. toggle strict true in project's .jshintrc) on legacy javascript project. there way aside adding "use strict"; line @ start of every single function in project?

for project (new or old) seems lot of avoidable boilerplate. how people (if @ all) typically handle it?

...aside adding "use strict"; line @ start of every single function in project?

yes, can add @ top of every file in project (this "code compilation" level); applies functions within file (code compilation unit).

this true inline script in web pages, fwiw, e.g.:

<script> "use strict"; // strict mode code function foo() {     // } </script> <script> // isn't </script> 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -