Suggestion for JS Debugging unit

Suggestion for JS Debugging unit
0

While working through this challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop

I wasted a bit of time wondering why the statement:

console.log(matrix);

seemed to be showing a single array. This might be a great time to introduce JSON.stringify(), as:

console.log(JSON.stringify(matrix));

If you use your browser’s console, you will see it is a two-dimensional array.

That leads into my next question:

Other than the brief mention a couple of challenges previous, where is the use of the Browser Console introduced?

I know it exists, but have no idea how to get to it. Even when I press F12 in a new tab, I don’t see anything meaningful re a debugging and/or testing and/or sandboxing environment.

I have worked through the first 9 projects ( Responsive Web Design * 5 and first 4 of Javascript Algorithms And Data Structures) since Wednesday but no mention of a browser consoles can i recall.

Those lessons you mention is where it is introduced. Free Code Camp is not meant to be a comprehensive resource. It introduces certain topics to you and then sometimes you must seek further information on your own.

If you are using Chrome, then hitting F12 will bring up the Console in the browser. You will see whenever you use console.log, the results will be displayed there.

Learning good debugging techniques is a vital skill for sure, but I’m not sure how well it really fits into the current pedagogy of the FCC challenges. The community here, of course, often jump in to introduce campers to tools and techniques, but you could help the community by helping create a consolidated resource. The Guide section Debugging JavaScript with Browser DevTools could use some love, or you could even contribute an article to Free Code Camp News.