We will explain in the following order:
Quick tour: debugging interface
How to debug: logging out to the console
How to debug: executing your code with specific input
How to debug: frontend challenges
How to debug: using 3rd party libraries
1. Quick tour: debugging interface
Run&Save - click this button to run the challenge’s default unit tests.
Useful for checking your score!
Debug - click this button to execute your source code.
Useful for debugging!
Test Output- check this tab to see the summary of your unit test results.
Each row is a link. Click on it to jump to the result details.
2. How to debug: logging out to the console
If you want to log out something to the console, using the Debug button is efficient.
and if you click Debug...
...you can see the message on the Console you logged out from the main function 🎉
The tests may not run correctly once you add this code. Please delete or comment out the code whenever you want to run tests.
3. How to debug: executing your code with specific input
If you would like to check the result of executing your code with specific input, using the debug feature if efficient.
Here we will explain the 2 ways to do so:
Execute the code using predefined input
Execute the code using customized input
1. Execute the code using the predefined input
To use the debug feature, click the cogwheel icon button.
Click the pull down menu.
Select the predefined input you would like to debug.
You can see what the predefined input is from this text area.
You can see the debug results on the Console tab 🎉
2. Execute the code using customized input
Click the cogwheel icon button.
Click the text box area.
Edit the input however you would like.
If it is an SQL challenge, you can input queries here instead.
Read: How to debug an SQL Challenge for more details.
You can see the debug results on your console 🎉
4. How to debug: frontend challenges
For frontend challenges, read: How to debug on a frontend development challenge for more details.
5. How to debug: using 3rd party libraries
If you would like to debug using 3rd party libraries, read: How to install libraries on a development/algorithm style challenge for more details.
That's it! Good luck :)