关键字 - 调试器|一个实际的例子 [英] Keyword - debugger | A practical example

查看:80
本文介绍了关键字 - 调试器|一个实际的例子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自 MDN


调用任何可用的调试功能。如果没有调试
功能可用,则此语句无效。

Invokes any available debugging functionality. If no debugging functionality is available, this statement has no effect.

我已在IE,Safari和FF并且发现不需要此关键字。它有实际用途吗?有人可以提供一个实际的例子吗?

I've debugged in IE, Safari, and FF and have found no need for this keyword. Does it have a practical use? Can someone provide a practical example?

推荐答案

键入调试器;在您的代码中触发与在调试实用程序中设置断点相同的功能。我有各种调试实用程序没有显示脚本,因为在cms中使用脚本或其他未知原因。然而,脚本仍然停止,并允许我检查变量的状态,我使用调试器;

Typing debugger; into your code triggers the same functionality as setting a breakpoint in the debugging utility. I have had various debugging utilities not show the script because of using a script inside a cms or other unknown reasons. However the scripts still halted and allowed me to check the state of variables where ever i used debugger;

这可能是一个实际的例子,但我找到了一个用途对于它。

This may be a stretch of a practical example but i have found a use for it.

技术上

debugger; 

似乎是触发调试实用程序的手动或编码方式,而不是在内部设置断点调试实用程序。希望这会有所帮助。

appears to be a manual or coding way to trigger a debug utility as opposed to setting a break point inside of a debug utility. Hope this helps.

这篇关于关键字 - 调试器|一个实际的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆