Javascript - Constant

About

constant in Javascript

The const keyword make the variable immutable.

Example

myObject = {
   prop1: 1,
   prop2: 2
};

// The const keyword make the variable immutable
const {prop1, var1, prop2} = myObject;

console.log("prop1 value is: "+prop1);
console.log("var1 value is: "+var1);
console.log("prop2 value is: "+prop2);







Share this page:
Follow us:
Task Runner