Also, write code which calls only really well documented functions. Doing jQuery("#my-input").val() is clear enough. Doing myCrazyFramework.dom.manuplators.find.get_value('my-input') is more obscure, even though it's more verbose.
Write code that's been written before. Don't use clever patterns you found on code snippet sharing websites (http://code.activestate.com/recipes/66531-singleton-we-dont-... for example). Keep using the same pattern over and over.
Write small chunks of code: a function over 50 lines is probably really hard to read. This is a rule of thumb, not a commandment, but I found it to be true in at least > 51% of cases.
Avoid code magic. E.g.: deleteUsers(username) should not check for whether username has the substring "test" in it to see if the user should really be deleted.
Avoid state at all cost.
Avoid timing dependence. Pretend like anything in your application can happen any time any place.
Handle all exceptions.
I'm probably wrong on at least 50% of the above, and am probably missing 10 time as much...
Decouple/Blackbox
Naming Conventions
Start using these techniques now, refactor old code over time
I use jsDoc (closure compiler's version, with data annotations). Because of this, I can't wrap all my code in a closure, which seems so popular these days. jsDoc won't parse through the closure. So, I use namespaces, and keep all my code in the global scope. It works great.