Improving JavaScript performance
Keep the following tips in mind while creating your JavaScript to improve the performance of your code:
Always use the
var statement to access variables.
For example, var message = "HELLO";
Always define JavaScript arrays to be of specific size, or with a list of initial elements.
For example, var s_objs = new Array(10);
Avoid using the
eval and
new functions.
Avoid using the
with statement.