Git - How to create constants in JavaScript?

Immutable in JavaScript is not necessarily constant.

ES5 is not having built in support for constants. If you want to declare constant you need to write variable name in ALL_CAPS so that anyone should not accidentally update the variable - that is the convention developers have followed for long time. // Declaring constant in ES5 var NAME = 'Gulshan Saini' console.log(NAME) // Output: Gulshan Saini Assigning new value to constant in ES5 // Declaring constant in ES5 var NAME = 'Gulshan Saini' // assign new value NAME = 'Aditi Saini' console. [Read More]