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 throws 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>

Output:

Type of a and b is not defined.
Please Share