Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Always put 'use strict'; at the top of your modules.

'use strict'; should be in the top of the scope you control. A global 'use strict'; would place the global scope into strict mode, so all your imported modules would be under strict mode too, and then third party code would break and you don't know why. IIRC jshint will pick this up.

To be honest, the whole guide seems like a shorter, less comprehensive version of the JS community's own Idiomatic JS https://github.com/rwaldron/idiomatic.js/



That's what that means. In CommonJS the top of the module is the topmost scope, in systems like RequireJS its the first thing in your closures




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: