Basically, the const keyword helps to prevent the variable to assign to another value. In simple terms, it will make the pointer immutable, but the value remains mutable. It is better because it cannot be reassigned and also make code easier to reason. Below is the example:
const somethingConst = 'some default value'
// A lot of code here...
console.log(somethingConst)
// You know what the code above will print
// without going through all the previous code.
// You just know it, since the variable cannot be changed
I hope this will help.
Want to become a Java expert? Join Java Certification now!!