In ES6 two keywords in addition to var when declaring variables, i.e. let and const. Before ES6, the only way to declare a variable was through the var keyword.
const defines a constant reference to a value. This means the reference cannot be changed. You cannot reassign a new value to it.
e.g. you cannot do this as TypeError comes
const a = 0;
a = 5;
Executing the above lines of code in terminal, we will get an error as:
Uncaught TypeError: Assignment to constant variable.
const variables must be initialized at the declaration time.
If the data…