I am going to look at the const keyword in JavaScript. We will see what it is, how to use it, and why it is important.
const is a keyword for declaring variables whose values cannot be reassigned after they are set. It is used to declare variables in JavaScript, and the values that you put inside the variable declared with const cannot be reassigned after being set. Constants help you to create read-only variables that stay the same throughout your code.
Declaring with the JavaScript const Keyword

You use const to declare a variable, give it a name, and assign a value.
const number = 23;
console.log(number); // 23
Reassignment with the JavaScript const Keyword

If you try to change this number by reassigning it, you will get an error.
const number = 23;
number = 56; // Uncaught TypeError: Assignment to constant variable.

This is the main property of const: you cannot reassign the value of a variable that you declared with const.
Objects and the JavaScript const Keyword

I am having an object declared with const. If I try to change a property inside the object, that is allowed.
const user = { name: 'Ram' };
user.name = 'Bob';
console.log(user.name); // Bob

It got changed because it is allowed when you go deep inside the object.
But if you try to reassign the complete object, you will face an error.
const user = { name: 'Ram' };
user = { name: 'sh' }; // Uncaught TypeError: Assignment to constant variable.

If you want to make any changes with a const variable that holds an object, you can change its properties, but if you try to redeclare or reassign the complete object again, you will get an error due to const.
Final Thoughts
const declares variables whose values cannot be reassigned after they are set. It helps you create read-only variables. For objects declared with const, changing a property is allowed, but reassigning the entire object is not.