InterviewSolution
Saved Bookmarks
| 1. |
What is ‘use strict’ in JavaScript? What are its advantages? |
|
Answer» The ‘use script’ expression is used to enable strict mode in JavaScript, which makes it EASIER to write GOOD JavaScript code. We can then run a restricted variant of JavaScript. The strict mode was introduced in ECMAScript version 5. Using strict mode eliminates some silent errors in JavaScript by changing them to throw errors. JavaScript code in strict mode can sometimes run faster than the same code WITHOUT the strict mode. Strict mode also ensures the SECURITY of JavaScript code and improves compiler EFFICIENCY. |
|