CP01 - Debugging

Debugging :

- Try to run multiple times with different input - Break a code in smaller part and test individual - When I run code and encounter an error, I try to read the error message line by line in the browser's inspect tool to find out which line has the error in VS Code. This helps me identify where to look in my code (which file and which line). - I use console.log to check if anything is being displayed in the browser's inspect tool, check variables and their values - Search on google how to solve that problem to find some example - Reading the documentation to confirm the correct syntax and check Typo in the code - Close and Re-open new terminal. (Kill Sever) - Make sure install all the packet correctly - Take a break and come back to it with fresh eyes can help to see the solution more clearly

Collaborative Debugging:

- This will be similar to independent debugging, but working with more people or as a team can help us find the solution faster. - We will review the code together and check if there are any typos. - One person can suggest a solution to fix the typo, and the other person can implement the change. - We can also use console.log, inspect, and search on Google to help with the debugging process. - We will discuss the issue and keep trying until we find a solution. It's important to listen to each other, give suggestions in a polite way to avoid crashing, and be kind to each other. - Take a break if need

Example of How I did :

When I search on Google, I copy an error and paste it into the search bar to see if anyone else has experienced the same error, and to find out how they resolved it. If I encounter an error or my browser crashes, the first thing I did, is check if the file I'm working on is located on the client side or server side. Then, I review the console log or error message to determine which file and line the error occurred on. After that, I check if the file is linked to any other page or function. Finally, I use Google to research the error I received and work on resolving it step by step. Here are some things that I check when troubleshooting: Whether I have imported the correct file Whether I have already run an install or seeds command Why the code is not working, such as which data I am trying to retrieve or which file I am referring to, what I expect to see on the screen, and where and how to retrieve that data from. Then, I try to console log the data that I want to retrieve to see if it is giving me the correct data or not, and check the data type (object, array, number, string). Whether I have rendered all the routes Trying to trace the origin of the data Watching YouTube videos and checking code from class while referring to it side by