we use this string or statement?
Structure of code
'use strict';
We will declare the before any code So here, everything in the file.js will be executed in strict mode.
- // File Name: mysamplejsfile.js
- 'use strict';
- var strcode = 0;
- .....
- .....
- // other code
- .....
- function sample() {
- 'use strict';
- ...
- // other code
- ...
- }
Note
For example, everything will be non-strict except for the function we mark 'use strict' inside the function.
0 Comments