62 lines
766 B
Markdown
62 lines
766 B
Markdown
JS的小知识.md
|
||
|
||
|
||
|
||
|
||
### 方法的注释
|
||
|
||
|
||
方法写完之后,我们在方法的前面输入`/**`,然后回车,会发现,注释的格式会自动补齐。
|
||
|
||
|
||
### 断点调试
|
||
|
||
(1)先让程序运行一遍。
|
||
|
||
(2)f12,弹出代码调试工具
|
||
|
||
(3)打断点:
|
||
|
||
![](http://img.smyhvae.com/20180124_2035.png)
|
||
|
||
然后刷新页面。
|
||
|
||
(4)一步步调试,每点击一次,执行一步:
|
||
|
||
![](http://img.smyhvae.com/20180124_2036.png)
|
||
|
||
(5)监视变量:
|
||
|
||
当然,也可以添加变量或者表达式到监视窗口。操作如下:
|
||
|
||
![](http://img.smyhvae.com/20180124_2037.png)
|
||
|
||
上图中,选择变量或表达式,然后右键add to watch.
|
||
|
||
然后监视窗口:
|
||
|
||
![](http://img.smyhvae.com/20180124_2038.png)
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|