时间:2021-07-01 10:21:17 帮助过:7人阅读
1.用chrome浏览器打开demo
2.按下f12键
3.添加断点
4.监视变量
5.查看控制台输入的日志
6.demo 代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Examples</title> <meta name="description" content=""> <meta name="keywords" content=""> <link href="" rel="stylesheet"> </head> <body> </body> </html> <script> var cnt = (function () { var index = 0; var add = function () { return ++index; }; return add; })(); var c=cnt(); alert(c); console.log(c); </script>
以上就是Chrome如何调试JavaScript的示例的详细内容,更多请关注Gxl网其它相关文章!