- Interpreted, not compiled
- Case-sensitve
- Whitespace insensitive except within quotes
- If script is placed in the head, script executes before page is loaded.
- If script is place in the body, page will load before script is executed.
- Generally, script should be placed at the bottom of the body.
- Avoid inline JS, place in separate .js files.
- Scripts called w/
<script src="my_script.js" type="text/javascript">
- 'type' required for validating HTML 4 Strict and XHTML, optional in HTML5.
- 'type' can be considered optional and safely omitted from script tag.
Google JavaScript Style Guide