Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics (Retired) Creating Reusable Code with Functions Variable Scope

Durdona Abdusamikovna
Durdona Abdusamikovna
1,553 Points

Can someone suggest me any JavaScript Debugger ... ? I really want to see how each line of codes are running.

It would be really helpful to get the idea about the scope ... I am sure even when I am using loops ... Thanks in advance

3 Answers

Honestly the best debugger I have seen for JavaScript has been inside Visual Studio. You can run the project right from the program, you can add break points at certain places in you code and inspect variables. I don't believe there is a free version of it yet, but it is coming. Microsoft is working on open sourcing their platform which also means they will be porting to mac an it will be free eventually. I believe the timeline is within the next year. You should be able to download a trial version (still only windows at this point) in the mean time, if you are having major issues running down a bug. If you guys have further questions or need help with setup you can reach out to me at jphillips05@gmail.com.

Igor Yamshchykov
Igor Yamshchykov
24,397 Points

Using Chrome or Mozilla web developer tools is the easiest way.

Open developer tools, then navigate to Sources tab, find your script, open it there, after that you can set breakpoints and debug each line of your code.

It's not really a debugger but I suggest using JSHint, which is a code linting tool. You can even set up a Grunt task to have JSHint automatically check your javascript each time you save a file.

Durdona Abdusamikovna
Durdona Abdusamikovna
1,553 Points

So there is no way of seeing how each line of code runs ? Let's say with Java I used Jeliot ... I want to see how each line runs ... want to see how scopes function

I'm not sure what you mean by seeing how each line of code runs. Are you talking about performance? Like how long it takes to run and other performance metrics?

To add to my comment below, you can also add break points in the chrome developer for your javascript files, but I have found that extremely tedious and cumbersome. But I can help set that up if needed.