Step through code

Step through code
0

#1

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…


#2

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/


#3

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:


#4

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.


#5

What’s a VS plugin? What is VS?


#6

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


#7

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


#8

I meant Visual Studio Code.


#9

Okay, I will look at that. Thank you.