DEV Community

Discussion on: Demystifying "const" variables in JavaScript

sunnysingh profile image
Sunny Singh Author • Edited on

I do, for real constants that are static values. Consider this example:

const BASE_URL = '';

const url = `${BASE_URL}/hello`;

Since url isn't a true constant (it uses another variable to determine its value), I keep it lowercase.

Also, I only use constant case at the top level scope, or when I'm importing constants from another file.