Break on a change of variable value

前端 未结 3 1956
一向
一向 2020-11-28 10:55

Similar to other questions here, like this one.

Is there a way to break on the change of a variable value in any JavaScript debugger? (like IE Developer tools, Visua

3条回答
  •  没有蜡笔的小新
    2020-11-28 11:28

    You don't even need an IDE - you can use "Object.watch()":

    Object.Watch Tutorial

    If you use any one debugger, I'd strongly recommend Firebug. For all your Javascript, HTML and CSS needs :-):

    http://getfirebug.com/javascript

    ===========================================================

    Update for 2019:

    • Object.Watch is Ancient History. Uncoincidentally, it's unavailable in most contemporary browsers.

    • My personal favorite JS debugging tool these days is Chrome Developer Tools.

    • My personal favorite JS IDE (for Angular, .Net Core, etc) is Microsoft Visual Studio Code (MSVC).

    • You can do just about any "expected" debugging operation - including set watches - with the Chrome debugger (just as you could with FF Firebug).

    • Chrome debugger is well integrated with the MSVC IDE.

    • Both are "free" (at least "free as in beer"); both run well on Windows, Mac and Linux.

提交回复
热议问题