JavaScript Strict Mode

In order to find and remove any silent error in a JavaScript code, “use strict”; expression is used. This expression is placed as the first statement in the code to enable the strict mode of debugging.

Note: It will throw an error if there is there any silent error in the JavaScript code.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
"use strict";
a = 2;
b = 5;
mul = a * b;
console.log(mul);
</script>
</body>
</html>
Please follow and like us:
Content Protection by DMCA.com