Firefox Developer Edition DevTools – Debugger  
Published: 2020-11-06 14:43:56

A couple of days ago, as I was getting familiar with ol' faithful, the [Mozilla Web Docs](https://developer.mozilla.org/en-US/), I came across one Mozilla's new projects – a "Developer Edition" browser. 

![It is aptly called **Firefox Browser Developer Edition**](https://dev-to-uploads.s3.amazonaws.com/i/sqro5mjq3kof0jtufk9w.png)

Now, obviously there is nothing wrong with ol' reliable, Google Chrome. Chrome's DevTools is one of the most indispensable tools in any developer's toolbox. 

Still, I'm a sucker for shiny new things, so I decided to waste a couple of minutes [downloading the browser](https://www.mozilla.org/en-US/firefox/developer/?utm_campaign=deved_inactive_css&utm_medium=referral&utm_source=developer.mozilla.org) and giving it its fair shot to live up its name and reputation. I mean, how could I resist something branded "**Developer Edition**" from the people that give us the MDN docs? 

So, to cut a long story short I'll just come out and say it: it is pretty fantastic. Firefox's Developer Edition DevTools has a design that reads great and feels intuitive, and is definitely a welcome addition to any toolbox. It even inspired me to learn how to use it's built in debugger! 

Mozilla offers a handy dandy [debugger playground](https://mozilladevelopers.github.io/playground/debugger) that guides you through a few starter examples with a simple to-do list react app. 

![Handy dandy simple react.js to-do list](https://dev-to-uploads.s3.amazonaws.com/i/l4q78va67j4oxll9dwes.png)

You can open up the DevTools by right-clicking and selecting inspect element. This will pop the DevTools up, typically to the side of the browser window. Like so:

![](https://dev-to-uploads.s3.amazonaws.com/i/mj747jw503i6wvrmxs1h.png)

At the top of the DevTools, clicking on **Debugger** will render three panes: **_Source List_**, **_Source_**, and **_Tools_**

## Source List & Source Panes

![The Source List and the Source panes](https://dev-to-uploads.s3.amazonaws.com/i/v29wvpdr81cguuwdo4s5.png)

The source list pane shows all the JavaScript files related to the current page or project, while the source pane shows the content of those files. For all intents and purposes, we can think of it very similarly to our typical editor, like Visual Studio Code. 
The left pane describes the locations of files and their relative structure to one another in relation to the whole application, and the pane to its right gives us a glimpse into whatever file is selected in the Source List. 

##Tools pane

![](https://dev-to-uploads.s3.amazonaws.com/i/l25o3ns96y780zfc72xz.png)

The leftmost pane is the Tools pane, and is where a lot of the useful tools that Firefox gives us (but not all of them!) can be accessed from. In particular **_Watch Expression_** and the **_Scope_** tabs are useful as they allow us to view whatever variables are in play at any given moment, thanks to **_Break Points_**. 

![A **Break Point** is added by clicking on the line number in the Source's gutter.](https://dev-to-uploads.s3.amazonaws.com/i/wcil3yl1qnvngoy38116.gif)

Break points are inserted by clicking on the line number in the Source's gutter. This should mark it with a blue flag, like above. Now, whenever the application is run, it will stop right at the line marked with the blue break point flag. 
In this case, that means that when we try to add an item to the to-do list, the program freezes. 

![](https://dev-to-uploads.s3.amazonaws.com/i/kjbvn3gcnhvigmv3uddn.png)

This might be a good time to go a little more in depth regarding the Tools pane, and in particular the toolbar. 

###Toolbar

![The Debugger Tools toolbar](https://dev-to-uploads.s3.amazonaws.com/i/damgx8hdw54ek4chltln.png)


1. Play/Pause
    * Pauses or resumes the execution of the code being debugged. This is useful when you want to continue running your code after hitting a break point – or to move on to the next break point quickly. 

    * tl;dr – used for stopping and starting the execution of the code in question

2. Step over
    * Executes the immediate next line after the inserted break point. If the next line happens to be a function, it will execute the entire function.

    * tl;dr – used for taking the next "step" single step down your code

3. Step in
    * If the line being "stepped" over is a a function, one can instead "step in" and execute the function line by line instead of all at once. 

    * tl;dr – used for "stepping into" functions and slowly working your way down its execution line-by-line

4. Step out
    * Steps out of a function and runs the code until another break point or until completion. 

    * tl;dr – used for getting out of the scope of a function and letting it run. 

###Watch Expression

![](https://dev-to-uploads.s3.amazonaws.com/i/rk1j0le4vv7hz0o4vzlu.gif)

The **_Watch Expression_** tab is also a very useful tool in its own right. By typing in an expression or variable into the tab, we can see how that expression comes to acquire or change its values, line-by-line, by using the debugger toolbar. 

###Scopes
![relative scopes when signing into an application](https://dev-to-uploads.s3.amazonaws.com/i/us4lvmc9h9ax3wx3sy3s.png)

Scopes is another incredibly simple and useful tool that helps you debug your code more easily. At whatever break point in your code, as with the Watch Expression tab above, your relevant scopes are presented to you. 

There is a *lot* that the DevTools offers, and as far as user experience goes, I'm happy and sold on this Mozilla browser. Keep in mind, though, that it is still in development mode and though I myself haven't found any glitches or pitfalls while using the application, always keep an open mind that something strange could happen. But as devs, I think we can handle a bug or two.