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

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -