Experience Share
76 views0 likes

JavaScript Naming conventions

Naming conventions and rules of variables in JavaScript.

Offor Janefrances
November 8, 2025
3 months ago

Naming conventions and rules of variables in JavaScript.

In JavaScript, variable names follow specific rules and conventions.

Rules:

  1. Must start with a letter or underscore_: Variable names must begin with a letter (a-z or A-Z) or an underscore (_).

  2. Can contain letters, digits, and underscores_: Variable names can include letters (a-z or A-Z), digits (0-9), and underscores (_).

  3. Cannot contain special characters: Variable names cannot include special characters like !, @, #, $, etc., except for underscore (_).

  4. Case-sensitive: JavaScript variable names are case-sensitive.

  5. Cannot be reserved words: Variable names cannot be reserved words like var, let, const, if, else, etc.

Conventions:

  1. Use meaningful names: Use descriptive and meaningful variable names to improve code readability.

  2. Use camelCase: JavaScript conventionally uses camelCase for variable names, where the first letter is lowercase and subsequent words are capitalized.

  3. Avoid abbreviations: Avoid using abbreviations unless they are widely accepted and understood.

  4. Be consistent: Follow a consistent naming convention throughout your code

Last updated: February 4, 2026

Written by: Offor Janefrances

More Articles

Deep Technology's

We are on an unwavering mission to be Nigeria's most loved software company, helping people discover new problem-solving strategies to solve problems around the globe.

NO 33 Democracy Crescent, Gaduwa Estate Gudu,Abuja FCT, Nigeria

© 2026 Deep Technology's. All rights reserved.