Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
use strict Directive
Collapse the table of content
Expand the table of content

use strict Directive

Restricts the use of some features in JavaScript. Supported in Internet Explorer 10 and Windows 8.x Store apps only.

use strict

The following code causes a syntax error because in strict mode all variables must be declared with var.

"use strict";
function testFunction(){
   var testvar = 4;
    return testvar;
}
intvar = 5;
Show:
© 2015 Microsoft