|
|
|
|
|
by epidemian
4010 days ago
|
|
In JS `const` just means that you can't reassign that variable, not that the value it references can't change: const a = {foo: 5};
a.foo = 42; // This is perfectly valid.
a = 'nope'; // But this isn't. It raises a SyntaxError.
|
|
It was to show how they want you to always use const with complex types.