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