Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
A powerful feature of debugging with Chrome is the ability to edit the code being executed on the fly and seeing your experiments without saving any files or restarting servers.
-
0:00
We found the problem by jumping inside a function and
-
0:03
experimented by changing the options in the debug console.
-
0:07
But there's another way you can experiment while debugging and
-
0:11
that's by editing the code life.
-
0:13
If we trigger the break-point again by refreshing the page,
-
0:17
on line 42 we can see that the reversed variable
-
0:20
is being passed into the local variables that are accessed by the template.
-
0:26
This is where we should be passing in the original variable too.
-
0:31
I can directly edit the line on 42 to test it out.
-
0:38
This doesn't save the file to disk,
-
0:40
it's editing the code running in the computer's memory.
-
0:45
When we hit Resume, it works.
-
0:50
We can temporarily disable the breakpoints with the Deactivate Breakpoints button.
-
0:57
And we can test out some other routes.
-
1:04
And it works, great.
-
1:07
You still have to use your code editor to include your fix there too, and save.
-
1:13
I hope you enjoyed seeing some of the debugging tools available to you, and
-
1:17
how they can improve your development cycle.
You need to sign up for Treehouse in order to download course files.
Sign up