Skip to content

Instantly share code, notes, and snippets.

@TheJase-Gist
TheJase-Gist / js-best-practices.md
Created March 14, 2012 06:50 — forked from davidcalhoun/js-best-practices.md
JavaScript best practices

JavaScript Best Practices

Code conventions

Closing/opening brackets

Although this isn't a problem in other languages, because of semicolon insertion, there could be problems if you don't place the bracket on the opening line:

// no:
function()
{
@TheJase-Gist
TheJase-Gist / index.html
Created March 14, 2012 05:52
HTML5 template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>
<script type="text/javascript">
</script>
<style text="text/css">