Let us declare strict mode. To declare, add the keyword “use strict” in the beginning. For global scope, declare it at the beginning of the script.
<!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>
An error would come, since you have used a variable, but forgot to declare it Press F8 to see the error.