Q:

Nodejs why should constants be variables

In the node js style guide it says that constants should be uppercase and declared with var instead of const
Can anyone explain why is it so?
I tought that const was invented to declare constants !?
Also, why should they be all uppercase? 
const FS = require('fs');

feels weird but
const SECOND = 1 * 1000;

feels ok.

A:

Using capitalized variables for constants was used before ES6 version. There is a common agreement to set the names of constants with uppercase to inform developers that the value of this variable must not be changed, another case was to set the private properties with prefix _. 
After ES6 there is a keyword const which is used to declare constants. Variables declared with const keyword don't let to change their value during the lifetime of the variable.

A:

This guide comes from 2011 (original source: http://nodeguide.com/style.html#constants), and at that time there wasn't es6. const in this guide means mozilla's const extension, that was supported by V8, but wasn't in ECMA standard or couldn't be be applied to class members.
But since this part of ES6 is pretty well supported in node.js (http://node.green/#ES2015-bindings-const) it is advised to use it to declare constants.
Bear in mind that what the const declaration does, it creates a read-only reference to a value. It DOES NOT mean that this value is innmutable, just the reference cannot be reassigned.

