edit SideBar
Using the above resources are a good way to have cleaner code.
There are plenty of articles about JavaScript best practices. This one is pretty good: