1. Best Practices
Code conventions from other languages can be used to decide when to comment and how to indent, but JavaScript needs to create special conventions for its loosely typed nature
L JavaScript should define behavior, HTML should define content, CSS should define appearance
The confusion in these responsibilities can lead to errors and maintenance problems that are difficult to debug
• The events that JavaScript takes to execute directly affect the performance of the Web page
L DOM Interaction is expensive and requires limiting the number of DOM operations
L can consider merging JavaScript files into a single file
L Use the compressor to make the file as small as possible
Use with HTTP compression to make JavaScript files as small as possible, with minimal impact on overall page performance
Javacript advanced Programming-best practices