Table of Contents
Let us declare strict mode. Add the keyword “use strict”, at the beginning, to declare strict mode. Declare it at the start of the script for global scope.
<!DOCTYPE html> <html> <body> <p>An error would come, since you have used a variable, but forgot to declare it</p> <p>Press F8 to see the error.</p> <script> "use strict"; a = 1; </script> </body> </html>