Debugging is finding errors in a script that keep it from functioning properly and fixing them.
Netscape has a debugger for Javascript that you can use:
There are also applications you can use which help you debug your Javascript, such as Homesite.