4 ms·
Comparing "const" and "var" is incorrect; the former is block-scoped (like "let"), while the latter is function-scoped. More to the point, "const" in JS is a m
by i80and 7y ago
Comparing "const" and "var" is incorrect; the former is block-scoped (like "let"), while the latter is function-scoped.
More to the point, "const" in JS is a maintainability tool to prevent accidental reassignment. I don't think people use it for performance reasons, nor should they.