A binding connects a name to a value. Reassignment changes the value associated with the name; mutation changes an object the binding refers to. section 5.1
Keep these rules distinct:
- `const` prevents reassignment, but does not prevent changing a mutable object through the binding. section 5.1
- `let` allows reassignment and is block-scoped, so it cannot be accessed outside its block. section 4.1
- Use `const` when a name need not be reassigned; use `let` when it does. section 5.2
const mutableConstant = {};
mutableConstant.foo = 'bar'; 1
mutableConstant.foo = 'baz'; 2
mutableConstant = {foo: 'bat'} 3
!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":2,\"ch\":40},{\"line\":2,\"ch\":41}],[{\"line\":3,\"ch\":40},{\"line\":3,\"ch\":41}],[{\"line\":5,\"ch\":40},{\"line\":5,\"ch\":41}]]"}
!@%STYLE%@!
The property changes mutate the existing object; assigning a new object to the `const` binding is not allowed. section 5.1










