Another way to greatly improve efficiency within a js file is to decrease repeated operations as much as possible. This consists of optimizing object handlers and adding dynamic event listeners in larger applications. Should you be using set interval it is a good idea to lessen the amount of times that the value is refreshed by. An animation of ui elements do not require a high frame rate to seem impressive.
Profiling and Debugging