JavasScript is an API language that allows you to write embedded programs to interact with the environment. The environment can be low level APIs such as browser DOM, WebKit library or Node.js process, or high level abstractions such as jQuery, Backbone, d3.js, etc.
GOOD JavaScript is the code that plays nicely with its environment. There is no strict best practice for every situation. You have to learn the language of your neighborhood.
Comments
JavasScript is an API language that allows you to write embedded programs to interact with the environment. The environment can be low level APIs such as browser DOM, WebKit library or Node.js process, or high level abstractions such as jQuery, Backbone, d3.js, etc.
GOOD JavaScript is the code that plays nicely with its environment. There is no strict best practice for every situation. You have to learn the language of your neighborhood.