constannounces a read link. You cannot change the value if declared with const. See Documentation from MDN :
The const declaration creates a read-only reference for the value. This does not mean that the value that it has is immutable, just the variable identifier cannot be reassigned.
For instance:
const x = {a:2};
x={b:3};
x.c=4;
So, it constprovides the following data:
!
, : var let. . , var . , var, let. .
ES6 ( MDN):
class Polygon {
constructor(height, width) {
this.height = height;
this.width = width;
}
}
Babel ( var):
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Polygon = function Polygon(height, width) {
_classCallCheck(this, Polygon);
this.height = height;
this.width = width;
};