General Naming Conventions for JavaScript

Generally speaking, what’s the recommended naming style for JavaScript?

It’s camelCase. ECMAScript, which is JavaScript’s core, uses the camelCase convention. Thus, when naming variables and functions, begin them with a lowercase letter and make each subsequent word begin with an uppercase letter. See the Examples section.

Many notable JavaScript style guides, such as the ones by Google, SproutCore, and Dojo, specify the use of camelCase. Also, don’t use Hungarian notation. It’s no longer recommended.


var aBasicVariable;
let aScopedVariable;
const aConstant;

function doSomething() {

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s