Constant look like a ‘var’ or ‘let’ variables but when const value once assign this value never be change. Const only have an option to help with to efficiency how your program run and manages your memory on the computer because you have some data or you have a variable in your program but you know its value never going to be change. The computer can be smart how to know the value never be change. When we use the const then computer know this is constant so the value never changes. This const keyword we use function or object not only variables. Now given bellow the constant example code and explain the code:
We can see the ‘let’ variable to reassign the value and also print the value but constant variables first assign value then prints but when we re assign the value into the constant variable it can’t assign it’s invalid. So constant variable value we can’t reassign the value.