re: Demystifying "const" variables in JavaScript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Do you like constant case?
 

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

const BASE_URL = 'http://example.com';

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.

code of conduct - report abuse