Skip to content

Commit ffb13cf

Browse files
authored
Merge pull request #131 from asci/patch-1
fix: const can't guarantee object immutability
2 parents 02b0546 + 4bcf39d commit ffb13cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ A variable that cannot be reassigned once defined.
313313

314314
```js
315315
const five = 5
316-
const john = {name: 'John', age: 30}
316+
const john = Object.freeze({name: 'John', age: 30})
317317
```
318318

319319
Constants are [referentially transparent](#referential-transparency). That is, they can be replaced with the values that they represent without affecting the result.

0 commit comments

Comments
 (0)