<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/variable-naming-best-practices-in-javascript-roqgkobf3" -->

---
title: Variable Naming Best Practices in JavaScript | daily.dev
description: Effective variable naming in JavaScript involves using &#x27;let&#x27; and &#x27;const&#x27; instead of &#x27;var&#x27;, choosing clear and descriptive names, adopting camel case...
canonical: https://daily.dev/posts/variable-naming-best-practices-in-javascript-roqgkobf3
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Variable Naming Best Practices in JavaScript | daily.dev
og:description: Effective variable naming in JavaScript involves using &#x27;let&#x27; and &#x27;const&#x27; instead of &#x27;var&#x27;, choosing clear and descriptive names, adopting camel case...
og:url: https://daily.dev/posts/variable-naming-best-practices-in-javascript-roqgkobf3
og:image: https://api.daily.dev/og/posts/roqgkOBF3.png
og:image:alt: Variable Naming Best Practices in JavaScript
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Variable Naming Best Practices in JavaScript

**[Medium](https://daily.dev/sources/medium_js)** · 4 min read · 1800 upvotes · 80 comments

## Summary

Effective variable naming in JavaScript involves using 'let' and 'const' instead of 'var', choosing clear and descriptive names, adopting camel case convention, using uppercase for constants, avoiding single-letter names, using plurals for arrays, and prefixing boolean variables. Establishing and adhering to a naming convention improves code readability and maintainability.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://javascript.plainenglish.io/variable-naming-best-practices-in-javascript-94af115f42cd>

## Community discussion

Top comments from developers on daily.dev.

**@matteobaccan** · 30 upvotes

> JavaScript coding conventions are starting to resemble those of Java more and more.

**@ghost** · 8 upvotes

> This is okay for veery very rookie programmers, like first week in the neighborhood - but if you not this guy it just like again the same article seen million times.
>
> Question, why article about naming variables starts with lessons about var, const, let, it totally another topic which you cannot just describe in few lines, because if I was a rookie and I will see this kinda stuff like "use letinstead of var, use const if you dont change anything" but without anything explained it's just pointless and make this article as just clickbait.
>
> Use javascript.info or whatever else guys and stop...

**@wael49** · 5 upvotes

> Very interesting article , I didn't know about number 7 Constants in Uppercase

**@koas** · 5 upvotes

> I abide to all rules except the single letter variables (in loops). Too many years using x for that 😅

**@rich\_tech123** · 3 upvotes

> Insightful Content

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/variable-naming-best-practices-in-javascript-roqgkobf3)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Variable Naming Best Practices in JavaScript","url":"https://daily.dev/posts/variable-naming-best-practices-in-javascript-roqgkobf3","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/variable-naming-best-practices-in-javascript-roqgkobf3"},"datePublished":"2024-09-05T06:32:52.566Z","dateModified":"2024-11-08T08:02:42.890Z","description":"Effective variable naming in JavaScript involves using 'let' and 'const' instead of 'var', choosing clear and descriptive names, adopting camel case...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3741bafbe43cd95e774fd2bd4afe0e3a?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3741bafbe43cd95e774fd2bd4afe0e3a?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":80,"discussionUrl":"https://daily.dev/posts/variable-naming-best-practices-in-javascript-roqgkobf3","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1800},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":80}],"keywords":"javascript","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Variable Naming Best Practices in JavaScript"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/variable-naming-best-practices-in-javascript-roqgkobf3","comment":[{"@type":"Comment","text":"JavaScript coding conventions are starting to resemble those of Java more and more.","datePublished":"2024-09-05T06:49:50.333Z","url":"https://daily.dev/posts/roqgkOBF3#c-mGJKQBA44","author":{"@type":"Person","name":"Matteo Baccan","url":"https://daily.dev/matteobaccan","image":"https://lh3.googleusercontent.com/a/ACg8ocKUjEqKPwKr49Pud1ml7mkJbUw7gATpjWn3JzDocf2Ymk2S3ds=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":30}},{"@type":"Comment","text":"This is okay for veery very rookie programmers, like first week in the neighborhood - but if you not this guy it just like again the same article seen million times.\nQuestion, why article about naming variables starts with lessons about var, const, let, it totally another topic which you cannot just describe in few lines, because if I was a rookie and I will see this kinda stuff like “use letinstead of var, use const if you dont change anything” but without anything explained it’s just pointless and make this article as just clickbait.\nUse javascript.info or whatever else guys and stop duplicating everything.","datePublished":"2024-09-06T07:08:09.292Z","dateModified":"2024-09-06T07:09:06.484Z","url":"https://daily.dev/posts/roqgkOBF3#c-D1P6xmGU1","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8}},{"@type":"Comment","text":"Very interesting article , I didn’t know about number 7 Constants in Uppercase","datePublished":"2024-09-05T15:12:34.144Z","url":"https://daily.dev/posts/roqgkOBF3#c-QYESC6TcW","author":{"@type":"Person","name":"Wael","url":"https://daily.dev/wael49","image":"https://media.daily.dev/image/upload/s--oXG6nixC--/f_auto/v1720105716/avatars/avatar_JA6qzgtW2NIr5fRdARXqd"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"I abide to all rules except the single letter variables (in loops). Too many years using x for that 😅","datePublished":"2024-09-06T06:57:04.453Z","url":"https://daily.dev/posts/roqgkOBF3#c-wmybE99uH","author":{"@type":"Person","name":"Álvaro Calleja","url":"https://daily.dev/koas","image":"https://lh3.googleusercontent.com/a/ACg8ocIf7BE9weTMCbCNP0lL6V5rw423xlYbgvS1mKI6hWWl6kydEeYPYQ=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"Insightful Content","datePublished":"2024-11-25T10:36:59.252Z","url":"https://daily.dev/posts/roqgkOBF3#c-KGEt1pcqt","author":{"@type":"Person","name":"Richard Raphael A.","url":"https://daily.dev/rich_tech123","image":"https://avatars.githubusercontent.com/u/129291730?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}}]}
```

