If creating a reference to an object, and the reference is not going to change (even though the object will), is it better to use const instead of var?
For example:
const is used for a variable constant, i.e. once declared, it's value is not supposed to change, whereas var
can be changed as per the will.
Use of const
and var
is solely on your will. For me it goes as follows
Mind it, re-declaring const
will immediately throw an error.