源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <h1>使用 "use strict":</h1> <h3>未来保留关键字不允许在严格模式下.</h3> <p>激活你的浏览器调试(F12)查看错误报告.</p> <script> "use strict"; var public = 1500; // This will cause an error </script> </body> </html>
运行结果