InterviewSolution
| 1. |
Explain the benefits and drawbacks of using "use strict". |
|
Answer» In ECMAScript5, a new feature known as strict mode allows you to run a program or function within a strict operating context. Certain ACTIONS, therefore, cannot be taken due to this strict context, and more exceptions are THROWN. When the "use strict" statement is used, the browser is instructed to use "strict" mode, which is a more restricted and safer JavaScript feature set. You can specify "use strict" at the top of a function to evaluate the JS in strict mode. In strict mode, more errors are thrown and some features are disabled to make your code more robust, clear, and accurate. Advantages:
Disadvantages:
|
|