4 ms·
const foo = {bar: 1} The only thing const about it is the reference `foo` cannot be reassigned: foo = something_else; // error Unlike `const` in C++, `co
by fryan 10y ago
const foo = {bar: 1}
The only thing const about it is the reference `foo` cannot be reassigned:
foo = something_else; // error
Unlike `const` in C++, `const` in javascript in not very useful in my opinion. `let` is shorter and more readable.