javascript - Can comments come before `use strict;`? -


i've seen few places around internet passively stating 'use strict;' must come on first line of functional scope want behavioral directive apply.

however, in experience, doesn't matter if there comments before it.

/* comment */ 'use strict'; 

is there functional deficiency having comments come before directive, or purely matter of style? defined anywhere in ecmascript specification?

i'm asking not v8 (node.js) environments, browsers well.

yes can add comments before "use strict";--it must appear before statements.

see example mdn

// whole-script strict mode syntax "use strict"; var v = "hi!  i'm strict mode script!"; 

Comments

Popular posts from this blog

jsf - How to order SelectItems in custom renderer extending MyFaces HtmlMenuRenderer -

Android : Making Listview full screen -

c# - How to share session between a MVC project and a WCF project? -