Best Practices
To highlight the presentation, I have talked about the following JavaScript best practices tips:
- Put stylesheets at the top (css)
- Move scripts to the bottom (javascript)
- Provide a clean separation of content, CSS, and JavaScript
- De-reference unused objects
- Think Asynchronous
- Working with Objects
- Defer Loading Resources
- Use JSLint -- Code Quality Tool
- Reduce the size of JavaScript file
- gzip
- General JavaScript Coding Best Practices
- Use === Instead of ==
- Eval = Bad
- Don’t Use Short-Hand
- Reduce Globals: Namespace
- Don't Pass a String to "SetInterval" or "SetTimeOut"
- Use {} Instead of New Object()
- Use [] Instead of New Array()