Step through code

How can I step through my code to see the results per line, or, at least see results as I add code. As it is, I type all the code in, run the test and see the results of the last line. This is frustrating when half of it is right!

PS. I’m on “Profile Lookup” and about 4 hours of sleep each night… punctuation is driving me nuts…

Not necessarily stepping through code line by line, but you can see the values of variables using a VS plugin called “Quokka”. If it shows a red box, then that means there’s some syntax error within that line.

another example

Plugin here:
https://quokkajs.com/

Have you started using console.log() to test your assumptions about what the code is doing yet? That can help you debug line by line if you like :slight_smile:

It’s easier to use console.log on something like codepen though - the test runner in the challenges means you log to the console for all of the tests.

See this challenge for more details:

You can use Chrome’s DevTools to put breakpoints in your code and step over and into lines of code. Open DevTools (F12), go to “Sources”, click to the left of a line number to set a breakpoint at that line.

What’s a VS plugin? What is VS?

I think console.log is what I was looking for. I knew I had seen it somewhere, but couldn’t figure out where.

1 Like

I will have to look into this for more advanced projects. Thanks!

I meant Visual Studio Code.

Okay, I will look at that. Thank you.