Quote:
Originally Posted by Grue
don't use const for objects or arrays unless you're actually reassigning them.
May I ask why you suggest this? I would think that "const" would mean "constant" and therefore an immutable global value.
I consider "let" local to the function, meaning that it is a temporary, immutable value within a function that is destroyed once it is used, then reinitialized in a function when the function is called again, and would never be global.
"Var" seems to be well, a variable, which ought to be modified either within the function or the global space.
Is there any intrinsic difference between these keywords in JS outside of aliases for var to show intent?