keyword was first introduced in javascript as part of ECMAScript 6 standard back in 2015. It probably the most popular way of declaring a variable in javascript, but how was javascript before them? const Hi rocks, Sasha here. Today we gonna see some alternatives to keyword in javascript before ES6. const const As mentioned above, was introduced in 2015 as part of the ES6 standard. const value is like but is used to define a constant value (obv). const block-scoped let Mutability The fact that it is constant doesn't mean it is immutable. It's a common misconception, but , such as . Let me show you some examples: any const object can change its properties any const array can change its data a = { : , : } a.msg = ; a = { : }; //const object example //declare a const object with id and msg const id 5 msg "Hello!" //change property of constant object "Hi!" //c changes it's value //reasign constant object msg "new object!" //TypeError: Assignment to constant variable. arr = [ , ]; arr.push( ); arr[ ] = ; arr = [ , ]; //const array example //declare const array const "Hello" "Constant" //push new element to array "works" //push new element - ok //change first element in array 0 "Hi!" //change first element - ok //reasign to new array "New" "Array" //change reference - TypeError: Assignment to constant variable. message = ; message = ; //primitive const value //declare consatnt string const "Constant string" "New constant string" //change value - TypeError: Assignment to constant variable. To sum up: creates an immutable pointer to a value, but a value its self remains mutable. If you want to create a completely immutable value you should use . const Object.freeze() const before ES6 So, how do you declare a constant value using standards previous to ES6? . Yeah. It was a good practice to declare a variable using an writing so that everyone knows it shouldn't be changed. Another way was to create a "repository" using . All the data declared inside IIFE are not visible neither changeable outside its scope. So you had to do something like this: You don't ALL_CAPS "immediately-invoked function expressions" (IIFE) ONE = ; TWO = ; ConstValues = ( { data = {}; data[ONE] = ; data[TWO] = ; { : { data[name]; } }; })(); two = ConstValues.get(TWO); ConstValues.data[TWO] = ; //declare constant values names var "ONE" var "TWO" //create a repositpory for them var ( ) function //(function(){})() creates a scoped function. //only get method is visible from outside, so no one can //change data var //create two constant values "uno" "due" //everything inside return will be visible outside return get ( ) function name return //get constant value var //due //change constant value "dos" //TypeError: Cannot set property 'TWO' of undefined //ConstValue.data is not visible here! (so you cannot change its properties) Charming, yeah. You can also use functions that always return the same value: { ; } CONST_VALUE(); { { value; } } a = constant( ); a(); //declare constant values as function ( ) function CONST_VALUE return "constant_value" //"constant_value" //function to create a function that returns a constant value ( ) function constant value return ( ) function return var 5 //5 Conclusion There were hard times for javascript developers. In this article, we've learned the basics of and some curious ways of creating "constant" values once upon a time in javascript. const P.S. You should always use each time the value won’t be reassigned, it makes easier to read the code and prevents some bugs and side effects. const